Browse Source

Merge branch 'master' into gradle-support

MeFisto94 5 years ago
parent
commit
db1af35168
100 changed files with 2523 additions and 1970 deletions
  1. 14 0
      .github/release-drafter.yml
  2. 1 0
      .gitignore
  3. 6 5
      .travis.yml
  4. 2 2
      ant-jme/lib/nblibraries.properties
  5. 515 160
      ant-jme/nbproject/build-impl.xml
  6. 2 2
      ant-jme/nbproject/genfiles.properties
  7. 12 0
      ant-jme/nbproject/project.properties
  8. 1 1
      branding/modules/org-netbeans-core.jar/org/netbeans/core/ui/Bundle.properties
  9. 40 28
      build.gradle
  10. 1 1
      build.xml
  11. 10 2
      build_engine.sh
  12. 4 0
      docs/building.md
  13. 13 1
      docs/maintaining.md
  14. 12 12
      fix_engine.sh
  15. 2 27
      gradle.properties
  16. BIN
      gradle/wrapper/gradle-wrapper.jar
  17. 1 1
      gradle/wrapper/gradle-wrapper.properties
  18. 19 3
      gradlew
  19. 17 1
      gradlew.bat
  20. BIN
      harness-override/app.exe
  21. BIN
      harness-override/app64.exe
  22. 4 4
      harness-override/override.properties
  23. 70 26
      jdks/download-jdks.sh
  24. 2 2
      jme3-assetpack-support/nbproject/genfiles.properties
  25. 1 1
      jme3-assetpack-support/nbproject/project.properties
  26. 2 5
      jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java
  27. 11 3
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java
  28. 9 4
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ImportAssetAction.java
  29. 19 12
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/PublishAssetPackAction.java
  30. 17 14
      jme3-assetpack-support/src/com/jme3/gde/assetpack/project/wizards/CreateProjectWizardIterator.java
  31. 4 4
      jme3-cinematics/nbproject/genfiles.properties
  32. 1 1
      jme3-code-check/nbproject/project.properties
  33. 0 9
      jme3-code-check/nbproject/project.xml
  34. 0 16
      jme3-code-check/src/com/jme3/gde/codecheck/hints/Bundle.properties
  35. 58 108
      jme3-code-check/src/com/jme3/gde/codecheck/hints/InternalMethodHint.java
  36. 63 116
      jme3-code-check/src/com/jme3/gde/codecheck/hints/ReadOnlyPrimitiveHint.java
  37. 119 138
      jme3-code-check/src/com/jme3/gde/codecheck/hints/TempVarsHint.java
  38. 67 118
      jme3-code-check/src/com/jme3/gde/codecheck/hints/UpdateHint.java
  39. 2 2
      jme3-codepalette/nbproject/genfiles.properties
  40. 4 4
      jme3-core-baselibs/nbproject/genfiles.properties
  41. 2 2
      jme3-core-updatecenters/nbproject/genfiles.properties
  42. 7 0
      jme3-core/nbproject/project.xml
  43. 5 9
      jme3-core/src/com/jme3/gde/core/appstates/NewAppStateWizardAction.java
  44. 5 7
      jme3-core/src/com/jme3/gde/core/appstates/RunAppStateAction.java
  45. 1 1
      jme3-core/src/com/jme3/gde/core/assets/AssetDataNode.java
  46. 10 7
      jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java
  47. 1 1
      jme3-core/src/com/jme3/gde/core/editor/nodes/ConnectionStraight.java
  48. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java
  49. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewDirectionalLightShadowFilterAction.java
  50. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewPointLightShadowFilterAction.java
  51. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/NewSpotLightShadowFilterAction.java
  52. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java
  53. 1 2
      jme3-core/src/com/jme3/gde/core/filters/impl/dlsf/DLSFWizardAction.java
  54. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/plsf/PLSFWizardAction.java
  55. 1 1
      jme3-core/src/com/jme3/gde/core/filters/impl/slsf/SLSFWizardAction.java
  56. 2 3
      jme3-core/src/com/jme3/gde/core/j2seproject/actions/UpgradeProjectWizardPanel1.java
  57. 11 2
      jme3-core/src/com/jme3/gde/core/navigator/SceneNavigatorPanel.java
  58. 24 23
      jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java
  59. 87 6
      jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java
  60. 47 58
      jme3-core/src/com/jme3/gde/core/scene/controller/SceneToolController.java
  61. 4 0
      jme3-core/src/com/jme3/gde/core/sceneviewer/Bundle.properties
  62. 44 0
      jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.form
  63. 52 1
      jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.java
  64. BIN
      jme3-core/src/com/jme3/gde/core/sceneviewer/pbrenv.j3o
  65. 2 2
      jme3-documentation/nbproject/genfiles.properties
  66. 1 1
      jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/GlslLanguage.java
  67. 2 2
      jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/lexer/GlslLexer.java
  68. 1 2
      jme3-gui/src/com/jme3/gde/gui/NiftyGuiDataObject.java
  69. 8 11
      jme3-gui/src/com/jme3/gde/gui/swing/ConvertToNifty.java
  70. 15 27
      jme3-gui/src/com/jme3/gde/gui/view/NiftyGuiVisualElement.java
  71. 12 2
      jme3-ios/ios-data/templates/ios.properties
  72. 99 21
      jme3-ios/ios-data/templates/project/jme-ios.xcodeproj/project.pbxproj
  73. 5 1
      jme3-ios/ios-data/templates/project/jme-ios/jme-ios-Info.plist
  74. 36 21
      jme3-ios/ios-data/templates/project/jme-ios/jmeAppDelegate.m
  75. 28 1
      jme3-ios/ios-data/templates/project/jme-ios/logging.properties
  76. 0 477
      jme3-ios/ios-data/templates/src/com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.c
  77. 0 319
      jme3-ios/ios-data/templates/src/com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.h
  78. 138 0
      jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosAL.c
  79. 173 0
      jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosAL.h
  80. 178 0
      jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosALC.c
  81. 77 0
      jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosALC.h
  82. 79 0
      jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosEFX.c
  83. 101 0
      jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosEFX.h
  84. 1 1
      jme3-ios/nbproject/project.properties
  85. 3 0
      jme3-ios/src/com/jme3/gde/ios/panel/IosCustomizerPanel.form
  86. 7 6
      jme3-ios/src/com/jme3/gde/ios/panel/IosCustomizerPanel.java
  87. 2 2
      jme3-lwjgl-applet/nbproject/genfiles.properties
  88. 4 6
      jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.form
  89. 6 5
      jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java
  90. 1 1
      jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java
  91. 37 40
      jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java
  92. 1 0
      jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java
  93. 2 2
      jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java
  94. 5 1
      jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.form
  95. 37 33
      jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java
  96. 3 3
      jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.form
  97. 3 3
      jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java
  98. 11 12
      jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java
  99. 5 2
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshAction.java
  100. 5 4
      jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshGenerator.java

+ 14 - 0
.github/release-drafter.yml

@@ -0,0 +1,14 @@
+categories:
+  - title: 🚀 Features
+    label: feature
+  - title: 🐛 Bug Fixes
+    label: bug
+
+name-template: "Upcoming Release"
+tag-template: "$NEXT_PATCH_VERSION"
+version-template: "v$MAJOR.$MINOR-codename-sdk$PATCH"
+change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
+template: |
+  ## Upcoming Changes
+
+  $CHANGES

+ 1 - 0
.gitignore

@@ -29,3 +29,4 @@ jdks/*.bin
 jdks/*.exe
 jdks/*.zip
 dist/
+/.nb-gradle/

+ 6 - 5
.travis.yml

@@ -1,5 +1,4 @@
 language: java
-sudo: false
 jdk: openjdk11
 dist: bionic
 
@@ -9,11 +8,10 @@ cache:
   directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
-   - netbeans
-   - jdks/local/8u152-b16/compiled
+   - jdks/local/*/compiled
 
 addons:
-  ssh_known_hosts: updates.jmonkeyengine.org
+  #ssh_known_hosts: updates.jmonkeyengine.org
   apt:
     packages:
     - p7zip-full
@@ -42,8 +40,9 @@ install:
   - ./build_engine.sh
   # Now we have to patch the engine
   - ./fix_engine.sh
+  # Can't do that currently was we now use engine/ as subproject...
   # Remove Engine Source and built class files since travis is low on disk space
-  - rm -rf engine/
+  # - rm -rf engine/
   - ./gradlew buildSdk
   #- '[ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ant -Dstorepass="$NBM_SIGN_PASS" hudson-nightly | awk "{printf(\".\"); fflush(stdout)}" || :'
   #- '[ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && scp -rp -i nbproject/private/www-updater.key build/updates/* [email protected]:/var/www/updates/nightly/3.1/plugins || :'
@@ -66,6 +65,8 @@ before_deploy:
   
   # Force Freeing Space.
   - rm -rf build/
+  - ./gradlew overrideHarness # This will patch the launcher exes to have our custom icon
+  - set -o pipefail # Allow failing in ant to be up-propagated
   - ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=true set-spec-version build-installers unset-spec-version | awk '{printf("."); fflush(stdout)}'
   
   # Has to be done before deploy (due to the rm command)

+ 2 - 2
ant-jme/lib/nblibraries.properties

@@ -1,6 +1,6 @@
 libs.ANT.classpath=\
     ${base}/ANT/ant.jar
 libs.CopyLibs.classpath=\
-    ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
+    ${base}/../../netbeans/java/ant/extra/org-netbeans-modules-java-j2seproject-copylibstask.jar
 libs.CopyLibs.displayName=CopyLibs Task
-libs.CopyLibs.prop-version=2.0
+libs.CopyLibs.prop-version=3.0

File diff suppressed because it is too large
+ 515 - 160
ant-jme/nbproject/build-impl.xml


+ 2 - 2
ant-jme/nbproject/genfiles.properties

@@ -4,5 +4,5 @@ [email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=dd1578ef
-nbproject/build-impl.xml.script.CRC32=f481ade2
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected].48
+nbproject/build-impl.xml.script.CRC32=4b0e1155
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected].48

+ 12 - 0
ant-jme/nbproject/project.properties

@@ -19,8 +19,12 @@ build.test.results.dir=${build.dir}/test/results
 #debug.transport=dt_socket
 debug.classpath=\
     ${run.classpath}
+debug.modulepath=\
+    ${run.modulepath}
 debug.test.classpath=\
     ${run.test.classpath}
+debug.test.modulepath=\
+    ${run.test.modulepath}
 # This directory is removed when the project is cleaned:
 dist.dir=dist
 dist.jar=${dist.dir}/ant-jme.jar
@@ -34,6 +38,8 @@ javac.classpath=\
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.deprecation=false
+javac.modulepath=
+javac.processormodulepath=
 javac.processorpath=\
     ${javac.classpath}
 javac.source=1.6
@@ -41,6 +47,8 @@ javac.target=1.6
 javac.test.classpath=\
     ${javac.classpath}:\
     ${build.classes.dir}
+javac.test.modulepath=\
+    ${javac.modulepath}
 javac.test.processorpath=\
     ${javac.test.classpath}
 javadoc.additionalparam=
@@ -64,8 +72,12 @@ run.classpath=\
 # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
 # or test-sys-prop.name=value to set system properties for unit tests):
 run.jvmargs=
+run.modulepath=\
+    ${javac.modulepath}
 run.test.classpath=\
     ${javac.test.classpath}:\
     ${build.test.classes.dir}
+run.test.modulepath=\
+    ${javac.test.modulepath}
 source.encoding=UTF-8
 src.dir=src

+ 1 - 1
branding/modules/org-netbeans-core.jar/org/netbeans/core/ui/Bundle.properties

@@ -1,3 +1,3 @@
-LBL_Copyright=<p><em>Copyright &copy; 2018 jMonkeyEngine.\n<br>Please visit <a style="color: #f3c802;" href="http://jmonkeyengine.org">http://jmonkeyengine.org</a> for more information.</em></p><p>Icons sets : <ul><li><a style="color: #f3c802;" href="http://brankic1979.com/icons/">Brankic1979</a></li><li><a style="color: #f3c802;" href="http://www.entypo.com/index.php">Entypo+</a></li><li><a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/ogli">Ogli</a> (edited by <a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/grizeldi">grizeldi</a></li><ul> </p>
+LBL_Copyright=<p><em>Copyright &copy; 2020 jMonkeyEngine.\n<br>Please visit <a style="color: #f3c802;" href="http://jmonkeyengine.org">http://jmonkeyengine.org</a> for more information.</em></p><p>Icons sets : <ul><li><a style="color: #f3c802;" href="http://brankic1979.com/icons/">Brankic1979</a></li><li><a style="color: #f3c802;" href="http://www.entypo.com/index.php">Entypo+</a></li><li><a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/ogli">Ogli</a> (edited by <a style="color: #f3c802;" href="https://hub.jmonkeyengine.org/u/grizeldi">grizeldi</a>)</li><ul> </p>
 updates_not_found=<p style="margin: 0"><b>Updates:</b> jMonkeyEngine SDK is updated to version {0}</p>\n 
 URL_ON_IMG=http://jmonkeyengine.org/

+ 40 - 28
build.gradle

@@ -33,7 +33,7 @@ repositories {
     }
 }
 
-if (System.getenv('TRAVIS') != null) {
+/*if (System.getenv('TRAVIS') != null) {
     if (System.env.TRAVIS_TAG != null && System.env.TRAVIS_TAG != "") { // Strangely it has to be both, because it's sometimes set as TRAVIS_TAG="" when we're in travis but no tag is set
         // v3.3.0-stable-sdk1 becomes 3.3.0-stable
         // Intentionally not using lastIndexOf here, we want the second "-".
@@ -69,7 +69,7 @@ if (System.getenv('TRAVIS') != null) {
 	
 	// This is the engine version that will be used per default on every regular commit
 	ext.jmeEngineVersion = "3.3.0" + ext.branchSpec + "-SNAPSHOT"
-}
+}*/
 
 configurations {
     corelibs
@@ -84,31 +84,34 @@ dependencies {
     corelibs dep("com.badlogicgames.gdx:gdx-ai:1.8.1", true, true)
     corelibs dep("javax.help:javahelp:2.0.05", false, false)
 
-    corelibs dep("org.jmonkeyengine:jme3-core:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-desktop:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-lwjgl:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-effects:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-blender:$jmeEngineVersion", true, true)
+    corelibs dep("org.jmonkeyengine:jme3-core", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-desktop", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-lwjgl", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-effects", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-blender", false, false)
 
-    corelibs dep("org.jmonkeyengine:jme3-bullet:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-bullet-native:$jmeEngineVersion", true, true)
+    corelibs dep("org.jmonkeyengine:jme3-bullet", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-bullet-native", false, false)
     corelibs dep(fileTree("lib"), false, false)
-    corelibs dep("org.jmonkeyengine:jme3-jogg:$jmeEngineVersion", true, true)
-
-    corelibs dep("org.jmonkeyengine:jme3-networking:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-niftygui:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-plugins:$jmeEngineVersion", true, true)
-    corelibs dep("org.jmonkeyengine:jme3-terrain:$jmeEngineVersion", true, true)
-
-    optlibs dep("org.jmonkeyengine:jme3-jbullet:$jmeEngineVersion", true, true)
-    optlibs dep("org.jmonkeyengine:jme3-jogl:$jmeEngineVersion", true, true)
-    optlibs dep("org.jmonkeyengine:jme3-android:$jmeEngineVersion", true, true)
-    optlibs dep("org.jmonkeyengine:jme3-ios:$jmeEngineVersion", true, true)
-    optlibs dep("org.jmonkeyengine:jme3-android-native:$jmeEngineVersion", true, true)
-    optlibs dep("org.jmonkeyengine:jme3-bullet-native-android:$jmeEngineVersion", true, true)
-    testdatalibs dep("org.jmonkeyengine:jme3-testdata:$jmeEngineVersion", false, false)
-
-    examplelibs dep("org.jmonkeyengine:jme3-examples:$jmeEngineVersion", false, true)
+    corelibs dep("org.jmonkeyengine:jme3-jogg", false, false)
+
+    corelibs dep("org.jmonkeyengine:jme3-networking", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-niftygui", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-plugins", false, false)
+    corelibs dep("org.jmonkeyengine:jme3-terrain", false, false)
+
+    optlibs dep("org.jmonkeyengine:jme3-jbullet", false, false)
+    optlibs dep("org.jmonkeyengine:jme3-jogl", false, false)
+    optlibs dep("org.jmonkeyengine:jme3-android", false, false)
+    optlibs dep("org.jmonkeyengine:jme3-ios", false, false)
+    optlibs dep("org.jmonkeyengine:jme3-android-native", false, false)
+    optlibs dep("org.jmonkeyengine:jme3-bullet-native-android", false, false)
+    optlibs dep("com.github.stephengold:Heart:5.0.0for33", false, false)
+    optlibs dep("com.github.stephengold:Minie:1.5.0for33", false, false)
+    optlibs dep("com.github.stephengold:Wes:0.4.8for33", false, false)
+    testdatalibs dep("org.jmonkeyengine:jme3-testdata", false, false)
+
+    examplelibs dep("org.jmonkeyengine:jme3-examples", false, false)
 
 }
 
@@ -568,7 +571,7 @@ ant.properties['plugins.version'] = jmeVersion
 ant.properties['app.version']= jmePomVersion
 ant.properties['nbm.revision']= jmeNbmRevision
 
-task overrideHarness(dependsOn: checkPlatformConfig) {
+task overrideHarness(dependsOn: ['checkPlatformConfig', 'updateNetbeans']) {
     doLast {
         def props = new Properties()
         props.load(new FileInputStream("$rootDir/harness-override/override.properties"))
@@ -612,6 +615,15 @@ task overrideHarness(dependsOn: checkPlatformConfig) {
 overrideHarness.outputs.files([ 'netbeans/harness/launchers/app.exe', 'netbeans/harness/launchers/app64.exe', 'netbeans/harness/launchers/pre7_app.exe'])
 overrideHarness.inputs.files([ 'netbeans/harness/launchers/app.exe', 'netbeans/harness/launchers/app64.exe', 'netbeans/harness/launchers/pre7_app.exe', 'harness-override/override.properties'])
 
+task updateNetbeans(type: Exec, dependsOn: checkPlatformConfig) {
+    ignoreExitValue true // We make netbeans fail by specifying "exit" which is no java file to open (this command would open the whole IDE)
+    if (org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.currentOperatingSystem.isWindows()) {
+        commandLine 'netbeans/bin/netbeans.exe', '--update-all', '--modules', '--refresh', '--nosplash', '--nogui', 'exit'
+    } else {
+        commandLine 'netbeans/bin/netbeans', '--update-all', '--modules', '--refresh', '--nosplash', '--nogui', 'exit'
+    }
+}
+
 task downloadAvian() {
     doLast {
         def avianFile = file("jme3-ios/src/com/jme3/gde/ios/avian-openjdk-mac.zip")
@@ -623,7 +635,7 @@ task downloadAvian() {
     }
 }
 
-task buildSdk(dependsOn: [copyBaseLibs, copyProjectLibs, createProjectXml, createBaseXml, copyTestSources, overrideHarness, downloadAvian]) {
+task buildSdk(dependsOn: [copyBaseLibs, copyProjectLibs, createProjectXml, createBaseXml, copyTestSources, downloadAvian]) {
     doLast {
         ant.propertyfile(file: "nbproject/project.properties") {
             entry( key: "plugins.version", value: "${jmeVersion}")
@@ -698,7 +710,7 @@ task fixPlatformIndependent(dependsOn: patchPlatformIndependent, type: Zip) {
 }
 
 wrapper {
-    gradleVersion = '4.10.2'
+    gradleVersion = '5.6.4'
 }
 
 //jar.dependsOn(buildSdk)

+ 1 - 1
build.xml

@@ -238,7 +238,7 @@
                 <if>
                     <equals arg1="${env.BUILD_X86}" arg2="true"/>
                     <then>
-                        <property name="temp.platform2" value="windows-x86 linux-x86 " />
+                        <property name="temp.platform2" value="windows-x86 " />
                         <echo message="Building for the X86 architecture "/>
                     </then>
                     <else>

+ 10 - 2
build_engine.sh

@@ -21,7 +21,15 @@ fi
 #echo "Patching the Engine...."
 #patch -s -N -p 1 < ../patches/FixHWSkinningSerialization.diff
 
-echo "Building the Engine and installing them to your local maven repo...."
-./gradlew -PbuildJavaDoc=true install # Depends on jarJavadoc, jarSourcecode, assemble, dist etc.
+# Remark: We don't build the engine from here anymore but instead use https://docs.gradle.org/current/userguide/composite_builds.html,
+# that way we don't have to care about versioning and don't spam the user's mavenLocal Repo. Also you only need this script really to
+# download the engine. Nothing a windows user couldn't do by hand.
+
+# Until https://github.com/jMonkeyEngine/jmonkeyengine/issues/1260 is solved, prebuild the engine manually
+echo "Prebuilding the engine to ensure native libraries are unzipped"
+./gradlew -PbuildJavaDoc=true build assemble
+
+#echo "Building the Engine and installing them to your local maven repo...."
+# ./gradlew -PbuildJavaDoc=true install # Depends on jarJavadoc, jarSourcecode, assemble, dist etc.
 
 cd ../

+ 4 - 0
docs/building.md

@@ -4,6 +4,10 @@ It's not really a big process but you should be familiar with the command line a
 We will skip the process of cloning the repo/downloading the zip, as the net is full of examples about this.  
 
 ## Defining the Engine Version  
+Note: The following explanation is somewhat outdate: We cannot download the Engine as Maven Dependency, as that misses critical stuff like jbullet.jar.
+Thus we have the scripts `build_engine.sh` and `fix_engine.sh`, which download and fix the engine install. Currently we use [Gradle Composite Builds](https://docs.gradle.org/current/userguide/composite_builds.html)
+The engine will be downloaded into an `engine` directory, so care about editing this repository, when trying to use a specific engine version.
+
 As the SDK has been split apart from the Engine Core, it simply downloads it as a dependency.  
 This comes in handy when it comes to build time however you're most likely unable to check your own engine changes.  
 

+ 13 - 1
docs/maintaining.md

@@ -68,4 +68,16 @@ Note: You must never ever upload/save the storepass in the git/web.
 When you then build the nbms, you have to specify the SecurePassword like so: `ant nbms -Dstorepass="SecurePassword"`. Keep in mind that you have to escape each backtick with three (3)! `\\\`'s.  
 To not show the key to the public, you can specify the StorePass as an Environment Variable inside of your CI Build System (Hudson, Travis, ...)  
 
-When all of this is completed, you just have to upload the nbms to the right server, we do that using the SCP Protocol which you can also see for uploading the maven artifacts.  
+When all of this is completed, you just have to upload the nbms to the right server, we do that using the SCP Protocol which you can also see for uploading the maven artifacts.  
+
+### Upgrading the internal Netbeans Installer Bundles
+Whenever something unpredictable goes wrong with the installers, this is something you can try.
+For Instance: At the time of writing, we've been upgrading for Java 8 to Java 11 and Netbeans 8 to Netbeans 11.
+Now unfortunately Oracle/The OpenJDK Devs changed the versioning scheme from "1.8.3-b04" to "11.0.5+10", so the installer failed at detecting the Java Version in place.
+One __can__ specify a minimum version, it just doesn't make sense, since we're shipping with a JDK anyway.
+Now here's the catch: Even though we did Upgrade to Netbeans 11, our installer was still the one of commit b8bc4aca4c575ec092363a72cc98d04a91cd95a0.
+
+
+How to Upgrade the internal Netbeans Installer Natives? Just copy the files from `netbeans/harness/modules/ext` to `nbi/antlib`, where we fetch our nbi dependency from.
+Do note that we don't need the `nbi-engine` folder, which seems to contain the same files, just not jar'ed.
+Also note that it might be a good idea to upgrade `nbi/antlib/version`, so we know which version is used.

+ 12 - 12
fix_engine.sh

@@ -1,18 +1,18 @@
 #!/bin/bash
 sdk=`pwd`
 
-echo "Patching the jme3-jbullet POM file"
-pushd ~/.m2/repository/org/jmonkeyengine/jme3-jbullet/ > /dev/null
-for d in *; do
-  if [ -d "$d" ]; then
-    pushd $d > /dev/null
-    mv jme3-jbullet-$d.pom jbullet.pom
-    patch < $sdk/patches/jbullet_dependencies_version_missing.diff
-    mv jbullet.pom jme3-jbullet-$d.pom
-    popd > /dev/null
-  fi
-done
-popd > /dev/null
+#echo "Patching the jme3-jbullet POM file"
+#pushd ~/.m2/repository/org/jmonkeyengine/jme3-jbullet/ > /dev/null
+#for d in *; do
+#  if [ -d "$d" ]; then
+#    pushd $d > /dev/null
+#    mv jme3-jbullet-$d.pom jbullet.pom
+#    patch < "$sdk/patches/jbullet_dependencies_version_missing.diff"
+#    mv jbullet.pom jme3-jbullet-$d.pom
+#    popd > /dev/null
+#  fi
+#done
+#popd > /dev/null
 
 echo "Installing our local jbullet.jar and stack-alloc.jar into the maven local repository"
 pushd lib > /dev/null

+ 2 - 27
gradle.properties

@@ -12,32 +12,7 @@ buildJavaDoc = true
 
 # specify if SDK and Native libraries get built
 buildSdkProject = true
-buildNativeProjects = false
-buildAndroidExamples = false
-
-# Path to android NDK for building native libraries
-#ndkPath=/Users/normenhansen/Documents/Code-Import/android-ndk-r7
-ndkPath = /opt/android-ndk-r10c
-
-# Path for downloading native Bullet
-bulletUrl = http://bullet.googlecode.com/files/bullet-2.82-r2704.zip
-bulletFolder = bullet-2.82-r2704
-bulletZipFile = bullet.zip
 
 # Path for downloading NetBeans Base
-netbeansUrl = http://apache.org/dist/incubator/netbeans/incubating-netbeans/incubating-11.0/incubating-netbeans-11.0-bin.zip
-
-# POM settings
-POM_NAME=jMonkeyEngine
-POM_DESCRIPTION=jMonkeyEngine is a 3D game engine for adventurous Java developers
-POM_URL=http://jmonkeyengine.org
-POM_SCM_URL=https://github.com/jMonkeyEngine/jmonkeyengine
-POM_SCM_CONNECTION=scm:git:git://github.com/jMonkeyEngine/jmonkeyengine.git
-POM_SCM_DEVELOPER_CONNECTION=scm:git:[email protected]:jMonkeyEngine/jmonkeyengine.git
-POM_LICENSE_NAME=New BSD (3-clause) License
-POM_LICENSE_URL=http://opensource.org/licenses/BSD-3-Clause
-POM_LICENSE_DISTRIBUTION=repo
-
-# Bintray settings to override in $HOME/.gradle/gradle.properties or ENV or commandline
-bintray_user=
-bintray_api_key=
+netbeansUrl = https://downloads.apache.org/netbeans/netbeans/11.3/netbeans-11.3-bin.zip
+# LTS: http://apache.org/dist/incubator/netbeans/incubating-netbeans/incubating-11.0/incubating-netbeans-11.0-bin.zip

BIN
gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 19 - 3
gradlew

@@ -1,5 +1,21 @@
 #!/usr/bin/env sh
 
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 ##############################################################################
 ##
 ##  Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
 APP_BASE_NAME=`basename "$0"`
 
 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
     GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
 fi
 
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
     JAVACMD=`cygpath --unix "$JAVACMD"`

+ 17 - 1
gradlew.bat

@@ -1,3 +1,19 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem      https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
 @if "%DEBUG%" == "" @echo off
 @rem ##########################################################################
 @rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
 set APP_HOME=%DIRNAME%
 
 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
 
 @rem Find java.exe
 if defined JAVA_HOME goto findJavaFromJavaHome

BIN
harness-override/app.exe


BIN
harness-override/app64.exe


+ 4 - 4
harness-override/override.properties

@@ -1,6 +1,6 @@
-app.exe.hashBefore=d2de975f102d9b5269fdb2839a57bb4fe199f451068ba2901027aafc66461af6
-app.exe.hashAfter=11b8ac04e1a95f6a74709d8f02ea1661e3be8923b26359c224063db94c3e8494
-app64.exe.hashBefore=f8dfc164788bb598f2ee0b1d3410c5fe446c38b9f0dee66e9371c5bd45fb6437
-app64.exe.hashAfter=d136b9f7e817889c57710e0fc72c1a3ce2187fe702de5321fd3650054593b196
+app.exe.hashBefore=cb062e75a53f65eccf904aea872675de5bd9929d698755897dd7df62185eca4d
+app.exe.hashAfter=891376025a56ea1ba1db2af5647e55dfb10a08f4575e78126de2857c686b3b6c
+app64.exe.hashBefore=79b32203242f46180bf786d589b53723bbccf0ef07b800932441cf03d47f1102
+app64.exe.hashAfter=ae90b815377d79174bee91f491317c3792863812be5d82fa3dae294c07a6e0eb
 pre7_app.exe.hashBefore=f4ea42a1ec2572b2a65a6d9baef0dd1f7293980c44c5d031c5b2ea5752352e49
 pre7_app.exe.hashAfter=fa8ae6457dad70a65cecb623ef0f60a86c92e856705eaeb2f22e43310fa9226f

+ 70 - 26
jdks/download-jdks.sh

@@ -10,8 +10,9 @@
 
 set -e # Quit on Error
 
-jdk_version="8u212"
-jdk_build_version="b04"
+jdk_major_version="11"
+jdk_version="0.6"
+jdk_build_version="10"
 platforms=( "x64_linux" "x86-32_windows" "x64_windows" "x64_mac" )
 
 # DEPRECATED (not required anymore)
@@ -71,7 +72,12 @@ function download_jdk {
     then
         echo "<<< Already existing, SKIPPING."
     else
-        curl -s -o downloads/jdk-$1$2 -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk$jdk_version-$jdk_build_version/OpenJDK8U-jdk_$1_hotspot_$jdk_version$jdk_build_version$2
+        if [ "$jdk_major_version" == "8" ];
+        then
+            curl -s -o downloads/jdk-$1$2 -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk$jdk_version-$jdk_build_version/OpenJDK8U-jdk_$1_hotspot_$jdk_version$jdk_build_version$2
+        else
+            curl -s -o downloads/jdk-$1$2 -L https://github.com/AdoptOpenJDK/openjdk$jdk_major_version-binaries/releases/download/jdk-$jdk_major_version.$jdk_version+$jdk_build_version/OpenJDK$jdk_major_version\U-jdk_$1_hotspot_$jdk_major_version.$jdk_version\_$jdk_build_version$2
+        fi
         echo "<<< OK!"
     fi
 }
@@ -89,12 +95,24 @@ function unpack_mac_jdk {
 
     download_jdk x64_mac .tar.gz
     tar xf downloads/jdk-x64_mac.tar.gz
-    cd jdk$jdk_version-$jdk_build_version/Contents/
+    if [ "$jdk_major_version" == "8" ];
+    then
+        cd jdk$jdk_version-$jdk_build_version/Contents/
+    else
+        cd jdk-$jdk_major_version.$jdk_version+$jdk_build_version/Contents/
+    fi
     # FROM HERE: build-osx-zip.sh by normen (with changes)
     mv Home jdk # rename folder
+    rm -rf jdk/man jdk/legal # ANT got stuck at the symlinks (https://bz.apache.org/bugzilla/show_bug.cgi?id=64053)
     zip -9 -r -y -q ../../compiled/jdk-macosx.zip jdk
     cd ../../
-    rm -rf jdk$jdk_version-$jdk_build_version
+    
+    if [ "$jdk_major_version" == "8" ];
+    then
+        rm -r jdk$jdk_version-$jdk_build_version
+    else
+        rm -rf jdk-$jdk_major_version.$jdk_version+$jdk_build_version
+    fi
 
     if [ "$TRAVIS" == "true" ]; then
         rm -rf downloads/jdk-x64_mac.tar.gz
@@ -112,7 +130,7 @@ function build_mac_jdk {
     fi
 
     rm -rf ../../jdk-macosx.zip
-    ln -s ./local/$jdk_version-$jdk_build_version/compiled/jdk-macosx.zip ../../ # Note that the first part is seen relative to the second one.
+    ln -rs compiled/jdk-macosx.zip ../../
     echo "< OK!"
 }
 
@@ -133,16 +151,24 @@ function unpack_windows {
     mkdir -p windows-$1
     unzip -qq downloads/jdk-$1_windows.zip -d windows-$1
     cd windows-$1/
-    mv jdk$jdk_version-$jdk_build_version/* .
-    rm -r jdk$jdk_version-$jdk_build_version
-    
-    # TODO: Why?
-    rm src.zip
     
+    if [ "$jdk_major_version" == "8" ];
+    then
+        mv jdk$jdk_version-$jdk_build_version/* .
+        rm -r jdk$jdk_version-$jdk_build_version
+        # TODO: Why?
+        rm src.zip
+    else
+        mv jdk-$jdk_major_version.$jdk_version+$jdk_build_version/* .
+        rm -rf jdk-$jdk_major_version.$jdk_version+$jdk_build_version
+    fi    
+
     # This seems to be replaced by lib/tools.jar in openJDK
     #unzip -qq tools.zip -d .
     #rm tools.zip
 
+    find . -exec chmod u+w {} \; # Make all file writable to allow uninstaller's cleaner to remove file    
+    
     find . -type f \( -name "*.exe" -o -name "*.dll" \) -exec chmod u+rwx {} \; # Make them executable
 
     find . -type f -name "*.pack" | while read eachFile; do
@@ -176,11 +202,16 @@ function unpack_linux {
     mkdir -p linux-$1
     cd linux-$1
     tar -xf "../downloads/jdk-$1_linux.tar.gz"
-    mv jdk$jdk_version-$jdk_build_version/* .
-    rm -r jdk$jdk_version-$jdk_build_version
-    
-    # TODO: Why?
-    rm src.zip
+    if [ "$jdk_major_version" == "8" ];
+    then
+        mv jdk$jdk_version-$jdk_build_version/* .
+        rm -r jdk$jdk_version-$jdk_build_version
+        # TODO: Why?
+        rm src.zip
+    else
+        mv jdk-$jdk_major_version.$jdk_version+$jdk_build_version/* .
+        rm -rf jdk-$jdk_major_version.$jdk_version+$jdk_build_version
+    fi
     
     cd ../
 
@@ -257,14 +288,14 @@ function build_other_jdk {
     fi
 
     rm -rf ../../$name
-    ln -s ./local/$jdk_version-$jdk_build_version/compiled/$name ../../ # Note that the first part is seen relative to the second one.
+    ln -rs compiled/$name ../../
     echo "< OK!"
 }
 
-mkdir -p local/$jdk_version-$jdk_build_version/downloads
-mkdir -p local/$jdk_version-$jdk_build_version/compiled
+mkdir -p local/$jdk_major_version-$jdk_version-$jdk_build_version/downloads
+mkdir -p local/$jdk_major_version-$jdk_version-$jdk_build_version/compiled
 
-cd local/$jdk_version-$jdk_build_version
+cd local/$jdk_major_version-$jdk_version-$jdk_build_version
 
 if [ "x$TRAVIS" != "x" ]; then
     if [ "x$BUILD_X64" != "x" ]; then
@@ -287,11 +318,24 @@ if [ "x$TRAVIS" != "x" ]; then
         rm -rf compiled/jdk-macosx.zip
     fi
 else
-    build_mac_jdk
-    build_other_jdk linux x64 x64
-    build_other_jdk windows x86-32 x86
-    build_other_jdk windows x64 x64
-    #Linux 32bit not supported... build_other_jdk linux x86-32
-    build_other_jdk linux x64 x64
+    if [ "x$PARALLEL" != "x" ];
+    then
+        build_mac_jdk &
+        build_other_jdk linux x64 x64 &
+        build_other_jdk windows x86-32 x86 &
+        build_other_jdk windows x64 x64 &
+    else
+        build_mac_jdk
+        build_other_jdk linux x64 x64
+        build_other_jdk windows x86-32 x86
+        build_other_jdk windows x64 x64
+        #Linux 32bit not supported... build_other_jdk linux x86-32
+    fi
+    
+fi
+
+if [ "x$PARALLEL" != "x" ];
+then
+    wait
 fi
 cd ../../

+ 2 - 2
jme3-assetpack-support/nbproject/genfiles.properties

@@ -3,6 +3,6 @@ build.xml.script.CRC32=c0969383
 [email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=68a35179
+nbproject/build-impl.xml.data.CRC32=d9c1f5c5
 nbproject/build-impl.xml.script.CRC32=4d376df0
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

+ 1 - 1
jme3-assetpack-support/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:49 +0200
-javac.source=1.6
+javac.source=10
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 2 - 5
jme3-assetpack-support/src/com/jme3/gde/assetpack/online/MultiPartFormOutputStream.java

@@ -6,9 +6,6 @@ package com.jme3.gde.assetpack.online;
 
 import java.io.*;
 import java.net.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.netbeans.api.progress.ProgressHandle;
 
 /**
  * <code>MultiPartFormOutputStream</code> is used to write
@@ -70,7 +67,7 @@ public class MultiPartFormOutputStream {
      */
     public void writeField(String name, boolean value)
             throws java.io.IOException {
-        writeField(name, new Boolean(value).toString());
+        writeField(name, Boolean.toString(value));
     }
 
     /**
@@ -142,7 +139,7 @@ public class MultiPartFormOutputStream {
      */
     public void writeField(String name, char value)
             throws java.io.IOException {
-        writeField(name, new Character(value).toString());
+        writeField(name, Character.valueOf(value).toString());
     }
 
     /**

+ 11 - 3
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java

@@ -35,6 +35,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -49,6 +50,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         if (!cancelled) {
             new Thread(new Runnable() {
 
+                @Override
                 public void run() {
                     scanDir(((AssetPackProject) context).getAssetsFolder().getPath(), deleteFiles);
                 }
@@ -62,8 +64,8 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         try {
             File zipDir = new File(dir2scan);
             String[] dirList = zipDir.list();
-            for (int i = 0; i < dirList.length; i++) {
-                File f = new File(zipDir, dirList[i]);
+            for (String dirList1 : dirList) {
+                File f = new File(zipDir, dirList1);
                 if (f.isDirectory()) {
                     String filePath = f.getPath();
                     scanDir(filePath, delete);
@@ -107,7 +109,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -122,6 +124,7 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         return panels;
     }
 
+    @Override
     public Object getValue(String key) {
         if (key.equals(NAME)) {
             return "Convert Binary Ogre Meshes..";
@@ -129,19 +132,24 @@ public final class ConvertOgreBinaryMeshesAction implements Action {
         return null;
     }
 
+    @Override
     public void putValue(String key, Object value) {
     }
 
+    @Override
     public void setEnabled(boolean b) {
     }
 
+    @Override
     public boolean isEnabled() {
         return true;
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     }
 }

+ 9 - 4
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ImportAssetAction.java

@@ -15,7 +15,6 @@ import java.awt.event.ActionEvent;
 import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.text.MessageFormat;
-import java.util.Iterator;
 import java.util.List;
 import javax.swing.Action;
 import javax.swing.JComponent;
@@ -34,6 +33,7 @@ public final class ImportAssetAction implements Action {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -65,8 +65,7 @@ public final class ImportAssetAction implements Action {
         asset.appendChild(license);
 
         List<FileDescription> files = (List<FileDescription>) desc.getProperty("filelist");
-        for (Iterator<FileDescription> it = files.iterator(); it.hasNext();) {
-            FileDescription fileObject = it.next();
+        for (FileDescription fileObject : files) {
             Element file = context.getConfiguration().createElement("file");
             asset.appendChild(file);
             file.setAttribute("path", fileObject.getPath() + fileObject.getFile().getNameExt());
@@ -117,7 +116,7 @@ public final class ImportAssetAction implements Action {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -132,6 +131,7 @@ public final class ImportAssetAction implements Action {
         return panels;
     }
 
+    @Override
     public Object getValue(String key) {
         if (key.equals(NAME)) {
             return "Add Asset..";
@@ -139,19 +139,24 @@ public final class ImportAssetAction implements Action {
         return null;
     }
 
+    @Override
     public void putValue(String key, Object value) {
     }
 
+    @Override
     public void setEnabled(boolean b) {
     }
 
+    @Override
     public boolean isEnabled() {
         return true;
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     }
 }

+ 19 - 12
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/PublishAssetPackAction.java

@@ -42,6 +42,7 @@ public final class PublishAssetPackAction implements Action {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -57,6 +58,7 @@ public final class PublishAssetPackAction implements Action {
         if (!cancelled) {
             new Thread(new Runnable() {
 
+                @Override
                 public void run() {
                     ProgressHandle handle = ProgressHandle.createHandle("Publishing AssetPack..");
                     handle.start();
@@ -67,7 +69,7 @@ public final class PublishAssetPackAction implements Action {
                     cleanup(wizardDescriptor);
                     handle.finish();
                 }
-            }).start();
+            }, "AssetPackPublisher").start();
         }
     }
 
@@ -87,23 +89,22 @@ public final class PublishAssetPackAction implements Action {
         try {
             FileObject[] dirList = dir2zip.getChildren();
             byte[] readBuffer = new byte[2156];
-            int bytesIn = 0;
-            for (int i = 0; i < dirList.length; i++) {
-                FileObject f = dirList[i];
+            int bytesIn;
+            for (FileObject f : dirList) {
                 if (f.isFolder()) {
                     zipDir(f, zos, fileName);
                     //loop again
                     continue;
                 }
-                InputStream fis = f.getInputStream();
                 if (!f.getNameExt().equals(fileName) && !f.getNameExt().startsWith(".")) {
-                    String filePathName = f.getPath().replaceAll(context.getProjectDirectory().getPath(), "");
-                    ZipEntry anEntry = new ZipEntry(filePathName);
-                    zos.putNextEntry(anEntry);
-                    while ((bytesIn = fis.read(readBuffer)) != -1) {
-                        zos.write(readBuffer, 0, bytesIn);
+                    try(InputStream fis = f.getInputStream()) {
+                        String filePathName = f.getPath().replaceAll(context.getProjectDirectory().getPath(), "");
+                        ZipEntry anEntry = new ZipEntry(filePathName);
+                        zos.putNextEntry(anEntry);
+                        while ((bytesIn = fis.read(readBuffer)) != -1) {
+                            zos.write(readBuffer, 0, bytesIn);
+                        }
                     }
-                    fis.close();
                 }
             }
         } catch (Exception e) {
@@ -162,7 +163,7 @@ public final class PublishAssetPackAction implements Action {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -177,6 +178,7 @@ public final class PublishAssetPackAction implements Action {
         return panels;
     }
 
+    @Override
     public Object getValue(String key) {
         if (key.equals(NAME)) {
             return "Publish AssetPack..";
@@ -184,19 +186,24 @@ public final class PublishAssetPackAction implements Action {
         return null;
     }
 
+    @Override
     public void putValue(String key, Object value) {
     }
 
+    @Override
     public void setEnabled(boolean b) {
     }
 
+    @Override
     public boolean isEnabled() {
         return true;
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     }
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     }
 }

+ 17 - 14
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/wizards/CreateProjectWizardIterator.java

@@ -41,7 +41,7 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
     private int index;
     private WizardDescriptor.Panel[] panels;
     private WizardDescriptor wiz;
-    private String name = "Create AssetPack Project";
+    private final String name = "Create AssetPack Project";
 
     public static CreateProjectWizardIterator createIterator() {
         return new CreateProjectWizardIterator();
@@ -68,7 +68,7 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -83,19 +83,23 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         return panels;
     }
 
+    @Override
     public void addChangeListener(ChangeListener l) {
 //        throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public void removeChangeListener(ChangeListener l) {
 //        throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    @Override
     public void initialize(WizardDescriptor wizard) {
         wiz = wizard;
         getPanels();
     }
 
+    @Override
     public void uninitialize(WizardDescriptor wizard) {
 //        this.wiz.putProperty("projdir", null);
 //        this.wiz.putProperty("name", null);
@@ -103,8 +107,9 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         panels = null;
     }
 
+    @Override
     public Set<FileObject> instantiate() throws IOException {
-        Set<FileObject> mySet = new LinkedHashSet<FileObject>();
+        Set<FileObject> mySet = new LinkedHashSet<>();
         //create folders
         File dirF = FileUtil.normalizeFile(new File((String) wiz.getProperty("folder")));
         dirF.mkdirs();
@@ -125,14 +130,17 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         return mySet;
     }
 
+    @Override
     public boolean hasNext() {
         return index < panels.length - 1;
     }
 
+    @Override
     public boolean hasPrevious() {
         return index > 0;
     }
 
+    @Override
     public void nextPanel() {
         if (!hasNext()) {
             throw new NoSuchElementException();
@@ -140,6 +148,7 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         index++;
     }
 
+    @Override
     public void previousPanel() {
         if (!hasPrevious()) {
             throw new NoSuchElementException();
@@ -147,16 +156,18 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
         index--;
     }
 
+    @Override
     public WizardDescriptor.Panel current() {
         return panels[index];
     }
 
+    @Override
     public String name() {
         return name;
     }
 
     private void unZipFile(InputStream source, FileObject projectRoot) throws IOException {
-        try {
+        try (source) {
             ZipInputStream str = new ZipInputStream(source);
             ZipEntry entry;
             while ((entry = str.getNextEntry()) != null) {
@@ -172,17 +183,12 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
                     }
                 }
             }
-        } finally {
-            source.close();
         }
     }
 
     private void writeFile(ZipInputStream str, FileObject fo) throws IOException {
-        OutputStream out = fo.getOutputStream();
-        try {
+        try (OutputStream out = fo.getOutputStream()) {
             FileUtil.copy(str, out);
-        } finally {
-            out.close();
         }
     }
 
@@ -198,11 +204,8 @@ public final class CreateProjectWizardIterator implements WizardDescriptor.Insta
             doc.getDocumentElement().setAttribute("name", (String) wiz.getProperty("name"));
             XMLUtil.findElement(doc.getDocumentElement(), "description", null).setTextContent((String) wiz.getProperty("description"));
             XMLUtil.findElement(doc.getDocumentElement(), "license", null).setTextContent((String) wiz.getProperty("license"));
-            OutputStream out = fo.getOutputStream();
-            try {
+            try (OutputStream out = fo.getOutputStream()) {
                 XMLUtil.write(doc, out, "UTF-8");
-            } finally {
-                out.close();
             }
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);

+ 4 - 4
jme3-cinematics/nbproject/genfiles.properties

@@ -1,8 +1,8 @@
-build.xml.data.CRC32=ec8899d4
+build.xml.data.CRC32=fb551ea0
 build.xml.script.CRC32=d8082083
-build.xml.stylesheet.CRC32=[email protected]
+build.xml.stylesheet.CRC32=[email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=ec8899d4
+nbproject/build-impl.xml.data.CRC32=fb551ea0
 nbproject/build-impl.xml.script.CRC32=a2681ce5
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

+ 1 - 1
jme3-code-check/nbproject/project.properties

@@ -1,5 +1,5 @@
 #Thu, 25 Aug 2011 20:26:50 +0200
-javac.source=1.6
+javac.source=1.8
 javac.compilerargs=-Xlint -Xlint\:-serial
 license.file=../license-jme.txt
 nbm.homepage=http\://www.jmonkeyengine.org

+ 0 - 9
jme3-code-check/nbproject/project.xml

@@ -75,15 +75,6 @@
                         <implementation-version/>
                     </run-dependency>
                 </dependency>
-                <dependency>
-                    <code-name-base>org.netbeans.modules.java.hints.legacy.spi</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <release-version>1</release-version>
-                        <implementation-version/>
-                    </run-dependency>
-                </dependency>
                 <dependency>
                     <code-name-base>org.netbeans.modules.java.source</code-name-base>
                     <build-prerequisite/>

+ 0 - 16
jme3-code-check/src/com/jme3/gde/codecheck/hints/Bundle.properties

@@ -1,16 +0,0 @@
-UpdateHint.display-name=Updating is not needed in jME3, check your update order if you need to call this.
-UpdateHint.id=Update States / Bound
-UpdateHint.description=Checks for calls to updateGeometricState(), updateLogicalState() and updateModelBound().
-UpdateHint.fix-text=Remove this call
-TempVarsHint.display-name=TempVars might not be released
-TempVarsHint.id=TempVars release check
-TempVarsHint.description=Checks for calls TempVars.get() and search for correspondinng release() call
-TempVarsHint.fix-text=Add a release() call at the end of the method
-ReadOnlyPrimitiveHint.display-name=This primitive is read only and should not be modified!
-ReadOnlyPrimitiveHint.id=ReadOnly Primitives
-ReadOnlyPrimitiveHint.description=Checks for modifications to readonly primitives. (getLocalTranslation().set())
-ReadOnlyPrimitiveHint.fix-text=Remove this call
-InternalMethodHint.display-name=You should not call this method, its for internal use only!
-InternalMethodHint.id=Internal Methods
-InternalMethodHint.description=Checks for calls to internal methods.
-InternalMethodHint.fix-text=Remove this call

+ 58 - 108
jme3-code-check/src/com/jme3/gde/codecheck/hints/InternalMethodHint.java

@@ -1,134 +1,84 @@
 package com.jme3.gde.codecheck.hints;
 
-import com.jme3.system.Annotations.Internal;
+import com.jme3.system.Annotations;
+import com.sun.source.tree.BlockTree;
+import com.sun.source.tree.StatementTree;
 import com.sun.source.tree.Tree;
-import com.sun.source.tree.Tree.Kind;
-import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EnumSet;
 import java.util.List;
-import java.util.Set;
-import javax.lang.model.element.Element;
-import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
-import org.netbeans.api.editor.EditorRegistry;
 import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.spi.AbstractHint;
-import org.netbeans.spi.editor.hints.ChangeInfo;
-import org.netbeans.spi.editor.hints.EnhancedFix;
+import org.netbeans.api.java.source.WorkingCopy;
 import org.netbeans.spi.editor.hints.ErrorDescription;
-import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
 import org.netbeans.spi.editor.hints.Fix;
-import org.openide.awt.StatusDisplayer;
+import org.netbeans.spi.editor.hints.Severity;
+import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
+import org.netbeans.spi.java.hints.Hint;
+import org.netbeans.spi.java.hints.HintContext;
+import org.netbeans.spi.java.hints.JavaFix;
+import org.netbeans.spi.java.hints.TriggerTreeKind;
 import org.openide.util.NbBundle;
 
-public class InternalMethodHint extends AbstractHint {
-
-    //This hint does not enable the IDE to fix the problem:
-    private static final List<Fix> NO_FIXES = Collections.<Fix>emptyList();
-    //This hint applies to method invocations:
-    private static final Set<Tree.Kind> TREE_KINDS =
-            EnumSet.<Tree.Kind>of(Tree.Kind.METHOD_INVOCATION);
-
-    public InternalMethodHint() {
-        super(true, true, AbstractHint.HintSeverity.WARNING);
-    }
-
-    //Specify the kind of code that the hint applies to, in this case,
-    //the hint applies to method invocations:
-    @Override
-    public Set<Kind> getTreeKinds() {
-        return TREE_KINDS;
-    }
-
-    @Override
-    public List<ErrorDescription> run(CompilationInfo info, TreePath treePath) {
-
-        Tree t = treePath.getLeaf();
-
-        Element el = info.getTrees().getElement(treePath);
-
-        if (el.getAnnotation(Internal.class) != null) {
-            //prepare selection for removing
-            JTextComponent editor = EditorRegistry.lastFocusedComponent();
-            Document doc = editor.getDocument();
-            SourcePositions sp = info.getTrees().getSourcePositions();
-            int start = (int) sp.getStartPosition(info.getCompilationUnit(), t);
-            int end = (int) sp.getEndPosition(info.getCompilationUnit(), t);
-            String bodyText = info.getText().substring(start, end);
-            //prepare fix
-            List<Fix> fixes = new ArrayList<Fix>();
-            fixes.add(new MessagesFix(doc, start, bodyText));
-
-            return Collections.<ErrorDescription>singletonList(
-                    ErrorDescriptionFactory.createErrorDescription(
-                    getSeverity().toEditorSeverity(),
-                    getDisplayName(),
-                    fixes,
-                    info.getFileObject(),
-                    (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), t),
-                    (int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), t)));
-
+@Hint(id = "#InternalMethodHint.id", displayName = "#InternalMethodHint.display-name",
+        description = "#InternalMethodHint.description", severity = Severity.WARNING,
+        category = "general")
[email protected]({
+    "InternalMethodHint.display-name=You should not call this method, its for internal use only!",
+    "InternalMethodHint.id=Internal Methods",
+    "InternalMethodHint.description=Checks for calls to internal methods.",
+    "InternalMethodHint.fix-text=Remove this call"
+})
+public class InternalMethodHint {
+
+    @TriggerTreeKind(Tree.Kind.METHOD_INVOCATION)
+    public static ErrorDescription hint(HintContext ctx) {
+        CompilationInfo info = ctx.getInfo();
+        TreePath treePath = ctx.getPath();
+        if (info.getTrees().getElement(treePath).getAnnotation(Annotations.Internal.class) != null) {
+                Fix fix = new InternalMethodHint.FixImpl(ctx.getInfo(), ctx.getPath()).toEditorFix();
+                return ErrorDescriptionFactory.forName(
+                        ctx,
+                        ctx.getPath(),
+                        Bundle.InternalMethodHint_display_name(),
+                    fix);
         }
 
         return null;
-
     }
 
-    //This is called if/when the hint processing is cancelled:
-    @Override
-    public void cancel() {
-    }
-
-    //Message that the user sees in the left sidebar:
-    @Override
-    public String getDisplayName() {
-        return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.display-name");
-    }
-
-    //Name of the hint in the Options window:
-    @Override
-    public String getId() {
-        return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.id");
-    }
-
-    //Description of the hint in the Options window:
-    @Override
-    public String getDescription() {
-        return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.description");
-    }
-
-    class MessagesFix implements EnhancedFix {
-
-        Document doc = null;
-        int start = 0;
-        String bodyText = null;
+    private static final class FixImpl extends JavaFix {
 
-        public MessagesFix(Document doc, int start, String bodyText) {
-            this.doc = doc;
-            this.start = start;
-            this.bodyText = bodyText;
-        }
-
-        @Override
-        public CharSequence getSortText() {
-            return "charsequence";
+        public FixImpl(CompilationInfo info, TreePath tp) {
+            super(info, tp);
         }
 
         @Override
-        public String getText() {
-            return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.fix-text");
+        protected String getText() {
+            return Bundle.InternalMethodHint_fix_text();
         }
 
         @Override
-        public ChangeInfo implement() throws Exception {
-            //Add 1 character, for the semi-colon:
-            doc.remove(start, bodyText.length() + 1);
-            //Display message to user in status bar:
-            StatusDisplayer.getDefault().setStatusText("Removed: " + bodyText);
-            return null;
+        protected void performRewrite(JavaFix.TransformationContext tc) throws Exception {
+            WorkingCopy wc = tc.getWorkingCopy();
+            TreePath statementPath = tc.getPath();
+            TreePath blockPath = tc.getPath().getParentPath();
+            while (!(blockPath.getLeaf() instanceof BlockTree)) {
+                statementPath = blockPath;
+                blockPath = blockPath.getParentPath();
+                if (blockPath == null) {
+                    return;
+                }
+            }
+            BlockTree blockTree = (BlockTree) blockPath.getLeaf();
+            List<? extends StatementTree> statements = blockTree.getStatements();
+            List<StatementTree> newStatements = new ArrayList<>();
+            for (StatementTree statement : statements) {
+                if (statement != statementPath.getLeaf()) {
+                    newStatements.add(statement);
+                }
+            }
+            BlockTree newBlockTree = wc.getTreeMaker().Block(newStatements, blockTree.isStatic());
+            wc.rewrite(blockTree, newBlockTree);
         }
     }
 }

+ 63 - 116
jme3-code-check/src/com/jme3/gde/codecheck/hints/ReadOnlyPrimitiveHint.java

@@ -1,144 +1,91 @@
 package com.jme3.gde.codecheck.hints;
 
-import com.jme3.system.Annotations.ReadOnly;
+import com.jme3.system.Annotations;
+import com.sun.source.tree.BlockTree;
+import com.sun.source.tree.StatementTree;
 import com.sun.source.tree.Tree;
-import com.sun.source.tree.Tree.Kind;
-import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EnumSet;
 import java.util.List;
-import java.util.Set;
-import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
-import org.netbeans.api.editor.EditorRegistry;
+import javax.lang.model.element.Element;
 import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.spi.AbstractHint;
-import org.netbeans.spi.editor.hints.ChangeInfo;
-import org.netbeans.spi.editor.hints.EnhancedFix;
+import org.netbeans.api.java.source.WorkingCopy;
 import org.netbeans.spi.editor.hints.ErrorDescription;
-import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
 import org.netbeans.spi.editor.hints.Fix;
-import org.openide.awt.StatusDisplayer;
+import org.netbeans.spi.editor.hints.Severity;
+import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
+import org.netbeans.spi.java.hints.Hint;
+import org.netbeans.spi.java.hints.HintContext;
+import org.netbeans.spi.java.hints.JavaFix;
+import org.netbeans.spi.java.hints.TriggerTreeKind;
 import org.openide.util.NbBundle;
 
-public class ReadOnlyPrimitiveHint extends AbstractHint {
-
-    //This hint does not enable the IDE to fix the problem:
-    private static final List<Fix> NO_FIXES = Collections.<Fix>emptyList();
-    //This hint applies to method invocations:
-    private static final Set<Tree.Kind> TREE_KINDS =
-            EnumSet.<Tree.Kind>of(Tree.Kind.METHOD_INVOCATION);
-
-    public ReadOnlyPrimitiveHint() {
-        super(true, true, AbstractHint.HintSeverity.WARNING);
-    }
-
-    //Specify the kind of code that the hint applies to, in this case,
-    //the hint applies to method invocations:
-    @Override
-    public Set<Kind> getTreeKinds() {
-        return TREE_KINDS;
-    }
-
-    @Override
-    public List<ErrorDescription> run(CompilationInfo info, TreePath treePath) {
-
-//        MethodInvocationTree mit = (MethodInvocationTree) treePath.getLeaf();
-//        ExpressionTree select = mit.getMethodSelect();
-//        TreePath method = new TreePath(treePath, select);
-//        Element el = info.getTrees().getElement(method);
-//        TypeElement invokedClass = (TypeElement) el.getEnclosingElement();
-
-        if (info.getTrees().getElement(treePath).getAnnotation(ReadOnly.class) != null) {
+@Hint(id = "#ReadOnlyPrimitiveHint.id", displayName = "#ReadOnlyPrimitiveHint.display-name",
+        description = "#ReadOnlyPrimitiveHint.description", severity = Severity.WARNING,
+        category = "general")
[email protected]({
+    "ReadOnlyPrimitiveHint.display-name=This primitive is read only and should not be modified!",
+    "ReadOnlyPrimitiveHint.id=ReadOnly Primitives",
+    "ReadOnlyPrimitiveHint.description=Checks for modifications to readonly primitives. (getLocalTranslation().set())",
+    "ReadOnlyPrimitiveHint.fix-text=Remove this call"
+})
+public class ReadOnlyPrimitiveHint {
+
+    @TriggerTreeKind(Tree.Kind.METHOD_INVOCATION)
+    public static ErrorDescription hint(HintContext ctx) {
+        CompilationInfo info = ctx.getInfo();
+        TreePath treePath = ctx.getPath();
+        if (info.getTrees().getElement(treePath).getAnnotation(Annotations.ReadOnly.class) != null) {
             Tree t = treePath.getLeaf();
-            //prepare selection for removing
-            JTextComponent editor = EditorRegistry.lastFocusedComponent();
-//            Document doc = editor.getDocument();
-            SourcePositions sp = info.getTrees().getSourcePositions();
-//            int start = (int) sp.getStartPosition(info.getCompilationUnit(), t);
-            int end = (int) sp.getEndPosition(info.getCompilationUnit(), t);
-
-            //TODO: add more checks
-            boolean fail = false;
-            if (info.getText().length() >= end + 4) {
-                String dotText = info.getText().substring(end, end + 4);
-                if (".set".equals(dotText)) {
-                    fail = true;
-                }
-            }
-
-            if (fail) {
-                return Collections.<ErrorDescription>singletonList(
-                        ErrorDescriptionFactory.createErrorDescription(
-                        getSeverity().toEditorSeverity(),
-                        getDisplayName(),
-                        NO_FIXES,
-                        info.getFileObject(),
-                        (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), t),
-                        (int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), t)));
+            Element el = info.getTrees().getElement(info.getTrees().getPath(info.getCompilationUnit(), t));
+
+            // TODO: add more checks
+            if (el.getSimpleName().toString().startsWith("set")) {
+                Fix fix = new ReadOnlyPrimitiveHint.FixImpl(ctx.getInfo(), ctx.getPath()).toEditorFix();
+                return ErrorDescriptionFactory.forName(
+                        ctx,
+                        ctx.getPath(),
+                        Bundle.ReadOnlyPrimitiveHint_display_name(),
+                        fix);
             }
-            return null;
-
         }
 
         return null;
-
-    }
-
-    //This is called if/when the hint processing is cancelled:
-    @Override
-    public void cancel() {
-    }
-
-    //Message that the user sees in the left sidebar:
-    @Override
-    public String getDisplayName() {
-        return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.display-name");
-    }
-
-    //Name of the hint in the Options window:
-    @Override
-    public String getId() {
-        return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.id");
-    }
-
-    //Description of the hint in the Options window:
-    @Override
-    public String getDescription() {
-        return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.description");
     }
 
-    class MessagesFix implements EnhancedFix {
-
-        Document doc = null;
-        int start = 0;
-        String bodyText = null;
+    private static final class FixImpl extends JavaFix {
 
-        public MessagesFix(Document doc, int start, String bodyText) {
-            this.doc = doc;
-            this.start = start;
-            this.bodyText = bodyText;
+        public FixImpl(CompilationInfo info, TreePath tp) {
+            super(info, tp);
         }
 
         @Override
-        public CharSequence getSortText() {
-            return "charsequence";
+        protected String getText() {
+            return Bundle.ReadOnlyPrimitiveHint_fix_text();
         }
 
         @Override
-        public String getText() {
-            return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.fix-text");
-        }
-
-        @Override
-        public ChangeInfo implement() throws Exception {
-            //Add 1 character, for the semi-colon:
-            doc.remove(start, bodyText.length() + 1);
-            //Display message to user in status bar:
-            StatusDisplayer.getDefault().setStatusText("Removed: " + bodyText);
-            return null;
+        protected void performRewrite(JavaFix.TransformationContext tc) throws Exception {
+            WorkingCopy wc = tc.getWorkingCopy();
+            TreePath statementPath = tc.getPath();
+            TreePath blockPath = tc.getPath().getParentPath();
+            while (!(blockPath.getLeaf() instanceof BlockTree)) {
+                statementPath = blockPath;
+                blockPath = blockPath.getParentPath();
+                if (blockPath == null) {
+                    return;
+                }
+            }
+            BlockTree blockTree = (BlockTree) blockPath.getLeaf();
+            List<? extends StatementTree> statements = blockTree.getStatements();
+            List<StatementTree> newStatements = new ArrayList<>();
+            for (StatementTree statement : statements) {
+                if (statement != statementPath.getLeaf()) {
+                    newStatements.add(statement);
+                }
+            }
+            BlockTree newBlockTree = wc.getTreeMaker().Block(newStatements, blockTree.isStatic());
+            wc.rewrite(blockTree, newBlockTree);
         }
     }
 }

+ 119 - 138
jme3-code-check/src/com/jme3/gde/codecheck/hints/TempVarsHint.java

@@ -1,198 +1,179 @@
 package com.jme3.gde.codecheck.hints;
 
+import com.sun.source.tree.BlockTree;
+import com.sun.source.tree.ExpressionStatementTree;
+import com.sun.source.tree.MemberSelectTree;
+import com.sun.source.tree.MethodInvocationTree;
 import com.sun.source.tree.MethodTree;
 import com.sun.source.tree.StatementTree;
 import com.sun.source.tree.Tree;
-import com.sun.source.tree.Tree.Kind;
 import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
-import java.util.EnumSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 import javax.lang.model.element.Element;
-import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
-import org.netbeans.api.editor.EditorRegistry;
 import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.spi.AbstractHint;
-import org.netbeans.spi.editor.hints.ChangeInfo;
-import org.netbeans.spi.editor.hints.EnhancedFix;
+import org.netbeans.api.java.source.TreeMaker;
+import org.netbeans.api.java.source.WorkingCopy;
 import org.netbeans.spi.editor.hints.ErrorDescription;
-import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
 import org.netbeans.spi.editor.hints.Fix;
-import org.openide.awt.StatusDisplayer;
+import org.netbeans.spi.editor.hints.Severity;
+import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
+import org.netbeans.spi.java.hints.Hint;
+import org.netbeans.spi.java.hints.HintContext;
+import org.netbeans.spi.java.hints.JavaFix;
+import org.netbeans.spi.java.hints.TriggerTreeKind;
 import org.openide.util.NbBundle;
 
-public class TempVarsHint extends AbstractHint {
-
-    //This hint does not enable the IDE to fix the problem:
-    private static final List<Fix> NO_FIXES = Collections.<Fix>emptyList();
-    //This hint applies to method invocations:
-    private static final Set<Tree.Kind> TREE_KINDS =
-            EnumSet.<Tree.Kind>of(Tree.Kind.METHOD);
-    private List<varsPosition> vars = new ArrayList<varsPosition>();
+@Hint(id = "#TempVarsHint.id", displayName = "#TempVarsHint.display-name",
+        description = "#TempVarsHint.description", severity = Severity.WARNING,
+        category = "general")
[email protected]({
+    "TempVarsHint.display-name=TempVars might not be released",
+    "TempVarsHint.id=TempVars release check",
+    "TempVarsHint.description=Checks for calls TempVars.get() and search for correspondinng release() call",
+    "TempVarsHint.fix-text=Add a release() call at the end of the method",})
+public class TempVarsHint {
+
+    @TriggerTreeKind(Tree.Kind.METHOD)
+    public static List<ErrorDescription> hint(HintContext ctx) {
+        MethodTree mt = (MethodTree) ctx.getPath().getLeaf();
+        CompilationInfo info = ctx.getInfo();
+
+        // Get the list of unreleased temp variables inside the method body
+        Collection<VarsPosition> vars = getUnreleasedTempVars(mt, info);
+        if (!vars.isEmpty()) {
+            List<ErrorDescription> list = new ArrayList<>(vars.size());
+
+            for (VarsPosition curVar : vars) {
+                Fix fix = new TempVarsHint.FixImpl(ctx.getInfo(), ctx.getPath(), curVar).toEditorFix();
+                list.add(ErrorDescriptionFactory.forSpan(
+                        ctx,
+                        curVar.start, curVar.end,
+                        Bundle.TempVarsHint_display_name(),
+                        fix));
+            }
 
-    public TempVarsHint() {
-        super(true, true, AbstractHint.HintSeverity.WARNING);
-    }
+            return list;
+        }
 
-    //Specify the kind of code that the hint applies to, in this case,
-    //the hint applies to method invocations:
-    @Override
-    public Set<Kind> getTreeKinds() {
-        return TREE_KINDS;
+        return null;
     }
 
-    @Override
-    public List<ErrorDescription> run(CompilationInfo info, TreePath treePath) {
-
-        MethodTree mt = (MethodTree) treePath.getLeaf();
-        vars.clear();
+    private static List<VarsPosition> getUnreleasedTempVars(MethodTree mt, CompilationInfo info) {
         if (mt.getBody() != null) {
+            List<VarsPosition> vars = null;
             for (StatementTree t : mt.getBody().getStatements()) {
 
-
                 if (t.getKind().equals(Tree.Kind.VARIABLE)) {
                     Element el = info.getTrees().getElement(info.getTrees().getPath(info.getCompilationUnit(), t));
-                    String name = t.toString();
+                    String realTypeName = el.asType().toString();
 
-                    //This is where it all happens: if the method invocation is 'showMessageDialog',
-                    //then the hint infrastructure kicks into action:
-                    if (name.indexOf("TempVars.get()") >= 0) {
+                    // Check that the variable type is TempVars
+                    if ("com.jme3.util.TempVars".equals(realTypeName)) {
 
                         SourcePositions sp = info.getTrees().getSourcePositions();
                         int start = (int) sp.getStartPosition(info.getCompilationUnit(), t);
                         int end = (int) sp.getEndPosition(info.getCompilationUnit(), t);
-                        vars.add(new varsPosition(el.getSimpleName().toString(), start, end));
+                        String variableName = el.getSimpleName().toString();
+                        if (vars == null) {
+                            vars = new ArrayList<>();
+                        }
+                        vars.add(new VarsPosition(variableName, start, end));
                         // System.err.println("TempVars.get() at " + start + " " + end+" for variable "+el.getSimpleName().toString());
                     }
 
                 }
-                if (t.getKind().equals(Tree.Kind.EXPRESSION_STATEMENT) && !vars.isEmpty()) {
-                    Element el = info.getTrees().getElement(treePath);
-                    String name = t.toString();
-
-
-                    if (name.indexOf(".release()") >= 0) {
-
-                        for (Iterator<varsPosition> it = vars.iterator(); it.hasNext();) {
-                            varsPosition curVar = it.next();
-                            //This is where it all happens: if the method invocation is 'showMessageDialog',
-                            //then the hint infrastructure kicks into action:
-                            if (name.indexOf(curVar.varName + ".release()") >= 0) {
-                                //prepare selection for removing                       
-                                it.remove();
-
-//                            SourcePositions sp = info.getTrees().getSourcePositions();
-//                            int start = (int) sp.getStartPosition(info.getCompilationUnit(), t);
-//                            int end = (int) sp.getEndPosition(info.getCompilationUnit(), t);
-//                            System.err.println(curVar.varName + ".release() at " + start + " " + end);
-
+                if (vars != null && !vars.isEmpty() && t.getKind().equals(Tree.Kind.EXPRESSION_STATEMENT)) {
+                    ExpressionStatementTree expressionStatementTree = (ExpressionStatementTree) t;
+                    if (expressionStatementTree.getExpression().getKind().equals(Tree.Kind.METHOD_INVOCATION)) {
+                        MethodInvocationTree methodInvocationTree = (MethodInvocationTree) expressionStatementTree.getExpression();
+
+                        // See that the method is called on a member
+                        if (methodInvocationTree.getMethodSelect().getKind().equals(Tree.Kind.MEMBER_SELECT)) {
+                            MemberSelectTree memberSelectTree = (MemberSelectTree) methodInvocationTree.getMethodSelect();
+                            Element el = info.getTrees().getElement(info.getTrees().getPath(info.getCompilationUnit(), methodInvocationTree));
+
+                            // Check that the method being called is "release"
+                            if ("release".equals(el.getSimpleName().toString())) {
+                                String variableName = memberSelectTree.getExpression().toString();
+                                for (Iterator<VarsPosition> it = vars.iterator(); it.hasNext();) {
+                                    VarsPosition curVar = it.next();
+                                    if (variableName.equals(curVar.varName)) {
+                                        //prepare selection for removing
+                                        it.remove();
+
+                                        //SourcePositions sp = info.getTrees().getSourcePositions();
+                                        //int start = (int) sp.getStartPosition(info.getCompilationUnit(), t);
+                                        //int end = (int) sp.getEndPosition(info.getCompilationUnit(), t);
+                                        //System.err.println(curVar.varName + ".release() at " + start + " " + end);
+                                        break;
+                                    }
+                                }
                             }
                         }
                     }
-
                 }
-
-
             }
-        }
-        if (!vars.isEmpty()) {
-            List<ErrorDescription> list = new ArrayList<ErrorDescription>();
-
-            JTextComponent editor = EditorRegistry.lastFocusedComponent();
-            Document doc = editor.getDocument();
-            List<Fix> fixes = new ArrayList<Fix>();
-            SourcePositions sp = info.getTrees().getSourcePositions();
-            int methodEnd = (int) (sp.getEndPosition(info.getCompilationUnit(), mt) - 1);
-
-            for (varsPosition curVar : vars) {
-                String bodyText = "    "+curVar.varName + ".release();\n    ";
-                fixes.clear();
-                fixes.add(new MessagesFix(doc, methodEnd, bodyText));
-
-                list.add(ErrorDescriptionFactory.createErrorDescription(
-                        getSeverity().toEditorSeverity(),
-                        getDisplayName(),
-                        fixes,
-                        info.getFileObject(),
-                        curVar.start, curVar.end));
-            }
-            return list;
-        }
-
-        return null;
-
-    }
-
-    //This is called if/when the hint processing is cancelled:
-    @Override
-    public void cancel() {
-    }
-
-    //Message that the user sees in the left sidebar:
-    @Override
-    public String getDisplayName() {
-        return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.display-name");
-    }
 
-    //Name of the hint in the Options window:
-    @Override
-    public String getId() {
-        return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.id");
-    }
+            return (vars == null ? Collections.emptyList() : vars);
+        }
 
-    //Description of the hint in the Options window:
-    @Override
-    public String getDescription() {
-        return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.description");
+        return Collections.emptyList();
     }
 
-    class MessagesFix implements EnhancedFix {
+    private static final class VarsPosition {
 
-        Document doc = null;
-        int start = 0;
-        String bodyText = null;
+        final String varName;
+        final int start;
+        final int end;
 
-        public MessagesFix(Document doc, int start, String bodyText) {
-            this.doc = doc;
+        public VarsPosition(String varName, int start, int end) {
+            this.varName = varName;
+            this.end = end;
             this.start = start;
-            this.bodyText = bodyText;
         }
 
         @Override
-        public CharSequence getSortText() {
-            return "charsequence";
+        public String toString() {
+            return varName;
         }
 
-        @Override
-        public String getText() {
-            return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.fix-text");
+    }
+
+    private static final class FixImpl extends JavaFix {
+
+        private final VarsPosition variable;
+
+        public FixImpl(CompilationInfo info, TreePath tp, VarsPosition variable) {
+            super(info, tp);
+            this.variable = variable;
         }
 
         @Override
-        public ChangeInfo implement() throws Exception {
-            //Adding the release call
-            doc.insertString(start, bodyText, null);            
-            //Display message to user in status bar:
-            StatusDisplayer.getDefault().setStatusText("Added: " + bodyText);
-            return null;
+        protected String getText() {
+            return Bundle.TempVarsHint_fix_text();
         }
-    }
-
-    class varsPosition {
 
-        String varName;
-        int start;
-        int end;
-
-        public varsPosition(String varName, int start, int end) {
-            this.varName = varName;
-            this.end = end;
-            this.start = start;
+        @Override
+        protected void performRewrite(JavaFix.TransformationContext tc) throws Exception {
+            WorkingCopy wc = tc.getWorkingCopy();
+            TreePath tp = tc.getPath();
+            final BlockTree oldBody = ((MethodTree) tp.getLeaf()).getBody();
+            if (oldBody == null) {
+                return;
+            }
+            TreeMaker make = wc.getTreeMaker();
+            List<? extends StatementTree> statements = oldBody.getStatements();
+            List<StatementTree> newStatements = new ArrayList<>(statements.size() + 1);
+            newStatements.addAll(statements);
+            newStatements.add(make.ExpressionStatement(make.MethodInvocation(Collections.emptyList(), make.MemberSelect(make.Identifier(variable.varName), "release"), Collections.emptyList())));
+
+            BlockTree newBlockTree = wc.getTreeMaker().Block(newStatements, oldBody.isStatic());
+            wc.rewrite(oldBody, newBlockTree);
         }
     }
 }

+ 67 - 118
jme3-code-check/src/com/jme3/gde/codecheck/hints/UpdateHint.java

@@ -1,136 +1,85 @@
 package com.jme3.gde.codecheck.hints;
 
-import com.sun.source.tree.Tree;
-import com.sun.source.tree.Tree.Kind;
-import com.sun.source.util.SourcePositions;
+import com.sun.source.tree.BlockTree;
+import com.sun.source.tree.StatementTree;
 import com.sun.source.util.TreePath;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EnumSet;
 import java.util.List;
-import java.util.Set;
-import javax.lang.model.element.Element;
-import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
-import org.netbeans.api.editor.EditorRegistry;
 import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.spi.AbstractHint;
-import org.netbeans.spi.editor.hints.ChangeInfo;
-import org.netbeans.spi.editor.hints.EnhancedFix;
+import org.netbeans.api.java.source.WorkingCopy;
 import org.netbeans.spi.editor.hints.ErrorDescription;
-import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
 import org.netbeans.spi.editor.hints.Fix;
-import org.openide.awt.StatusDisplayer;
+import org.netbeans.spi.editor.hints.Severity;
+import org.netbeans.spi.java.hints.ConstraintVariableType;
+import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
+import org.netbeans.spi.java.hints.Hint;
+import org.netbeans.spi.java.hints.HintContext;
+import org.netbeans.spi.java.hints.JavaFix;
+import org.netbeans.spi.java.hints.TriggerPattern;
+import org.netbeans.spi.java.hints.TriggerPatterns;
 import org.openide.util.NbBundle;
 
-public class UpdateHint extends AbstractHint {
-
-    //This hint does not enable the IDE to fix the problem:
-    private static final List<Fix> NO_FIXES = Collections.<Fix>emptyList();
-    //This hint applies to method invocations:
-    private static final Set<Tree.Kind> TREE_KINDS =
-            EnumSet.<Tree.Kind>of(Tree.Kind.METHOD_INVOCATION);
-
-    public UpdateHint() {
-        super(true, true, AbstractHint.HintSeverity.WARNING);
-    }
-
-    //Specify the kind of code that the hint applies to, in this case,
-    //the hint applies to method invocations:
-    @Override
-    public Set<Kind> getTreeKinds() {
-        return TREE_KINDS;
-    }
-
-    @Override
-    public List<ErrorDescription> run(CompilationInfo info, TreePath treePath) {
-
-        Tree t = treePath.getLeaf();
-
-        Element el = info.getTrees().getElement(treePath);
-        String name = el.getSimpleName().toString();
-
-        //This is where it all happens: if the method invocation is 'showMessageDialog',
-        //then the hint infrastructure kicks into action:
-        if (name.equals("updateGeometricState") || name.equals("updateLogicalState") || name.equals("updateModelBound")) {
-            //prepare selection for removing
-            JTextComponent editor = EditorRegistry.lastFocusedComponent();
-            Document doc = editor.getDocument();
-            SourcePositions sp = info.getTrees().getSourcePositions();
-            int start = (int) sp.getStartPosition(info.getCompilationUnit(), t);
-            int end = (int) sp.getEndPosition(info.getCompilationUnit(), t);
-            String bodyText = info.getText().substring(start, end);
-            //prepare fix
-            List<Fix> fixes = new ArrayList<Fix>();
-            fixes.add(new MessagesFix(doc, start, bodyText));
-
-            return Collections.<ErrorDescription>singletonList(
-                    ErrorDescriptionFactory.createErrorDescription(
-                    getSeverity().toEditorSeverity(),
-                    getDisplayName(),
-                    fixes,
-                    info.getFileObject(),
-                    (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), t),
-                    (int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), t)));
-
-        }
-
-        return null;
-
-    }
-
-    //This is called if/when the hint processing is cancelled:
-    @Override
-    public void cancel() {
-    }
-
-    //Message that the user sees in the left sidebar:
-    @Override
-    public String getDisplayName() {
-        return NbBundle.getMessage(UpdateHint.class, "UpdateHint.display-name");
-    }
-
-    //Name of the hint in the Options window:
-    @Override
-    public String getId() {
-        return NbBundle.getMessage(UpdateHint.class, "UpdateHint.id");
-    }
-
-    //Description of the hint in the Options window:
-    @Override
-    public String getDescription() {
-        return NbBundle.getMessage(UpdateHint.class, "UpdateHint.description");
-    }
-
-    class MessagesFix implements EnhancedFix {
-
-        Document doc = null;
-        int start = 0;
-        String bodyText = null;
-
-        public MessagesFix(Document doc, int start, String bodyText) {
-            this.doc = doc;
-            this.start = start;
-            this.bodyText = bodyText;
-        }
-
-        @Override
-        public CharSequence getSortText() {
-            return "charsequence";
+@Hint(id = "#UpdateHint.id", displayName = "#UpdateHint.display-name",
+        description = "#UpdateHint.description", severity = Severity.WARNING,
+        category = "general")
[email protected]({
+    "UpdateHint.id=Update States / Bound",
+    "UpdateHint.display-name=Updating is not needed in jME3, check your update order if you need to call this.",
+    "UpdateHint.description=Checks for calls to updateGeometricState(), updateLogicalState() and updateModelBound().",
+    "UpdateHint.fix-text=Remove this call"
+})
+public class UpdateHint {
+
+     @TriggerPatterns({
+         @TriggerPattern(value = "$type.updateGeometricState",
+                 constraints=@ConstraintVariableType(variable="$type", type="com.jme3.scene.Spatial")),
+         @TriggerPattern(value = "$type.updateLogicalState",
+                 constraints=@ConstraintVariableType(variable="$type", type="com.jme3.scene.Spatial")),
+         @TriggerPattern(value = "$type.updateModelBound",
+                 constraints=@ConstraintVariableType(variable="$type", type="com.jme3.scene.Spatial"))
+     })
+     public static ErrorDescription hint(HintContext ctx) {
+         Fix fix = new FixImpl(ctx.getInfo(), ctx.getPath()).toEditorFix();
+         return ErrorDescriptionFactory.forName(
+                 ctx,
+                 ctx.getPath(),
+                 Bundle.UpdateHint_display_name(),
+                 fix);
+     }
+
+    private static final class FixImpl extends JavaFix {
+
+        public FixImpl(CompilationInfo info, TreePath tp) {
+            super(info, tp);
         }
 
         @Override
-        public String getText() {
-            return NbBundle.getMessage(UpdateHint.class, "UpdateHint.fix-text");
+        protected String getText() {
+            return Bundle.UpdateHint_fix_text();
         }
 
         @Override
-        public ChangeInfo implement() throws Exception {
-            //Add 1 character, for the semi-colon:
-            doc.remove(start, bodyText.length() + 1);
-            //Display message to user in status bar:
-            StatusDisplayer.getDefault().setStatusText("Removed: " + bodyText);
-            return null;
+        protected void performRewrite(TransformationContext tc) throws Exception {
+            WorkingCopy wc = tc.getWorkingCopy();
+            TreePath statementPath = tc.getPath();
+            TreePath blockPath = tc.getPath().getParentPath();
+            while (!(blockPath.getLeaf() instanceof BlockTree)) {
+                statementPath = blockPath;
+                blockPath = blockPath.getParentPath();
+                if (blockPath == null) {
+                    return;
+                }
+            }
+            BlockTree blockTree = (BlockTree) blockPath.getLeaf();
+            List<? extends StatementTree> statements = blockTree.getStatements();
+            List<StatementTree> newStatements = new ArrayList<>();
+            for (StatementTree statement : statements) {
+                if (statement != statementPath.getLeaf()) {
+                    newStatements.add(statement);
+                }
+            }
+            BlockTree newBlockTree = wc.getTreeMaker().Block(newStatements, blockTree.isStatic());
+            wc.rewrite(blockTree, newBlockTree);
         }
     }
-}
+}

+ 2 - 2
jme3-codepalette/nbproject/genfiles.properties

@@ -1,8 +1,8 @@
 build.xml.data.CRC32=3b9099db
 build.xml.script.CRC32=27967d2c
-build.xml.stylesheet.CRC32=[email protected]
+build.xml.stylesheet.CRC32=[email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=3b9099db
 nbproject/build-impl.xml.script.CRC32=c9af9eda
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

+ 4 - 4
jme3-core-baselibs/nbproject/genfiles.properties

@@ -1,8 +1,8 @@
-build.xml.data.CRC32=d43b0890
+build.xml.data.CRC32=dd2eed71
 build.xml.script.CRC32=cdae6a36
-build.xml.stylesheet.CRC32=[email protected]
+build.xml.stylesheet.CRC32=[email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=d43b0890
+nbproject/build-impl.xml.data.CRC32=dd2eed71
 nbproject/build-impl.xml.script.CRC32=246f9b81
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

+ 2 - 2
jme3-core-updatecenters/nbproject/genfiles.properties

@@ -1,8 +1,8 @@
 build.xml.data.CRC32=78701114
 build.xml.script.CRC32=cfa8d5c5
-build.xml.stylesheet.CRC32=[email protected]
+build.xml.stylesheet.CRC32=[email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=78701114
 nbproject/build-impl.xml.script.CRC32=270846fb
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

+ 7 - 0
jme3-core/nbproject/project.xml

@@ -30,6 +30,13 @@
                         <specification-version>3.3.0</specification-version>
                     </run-dependency>
                 </dependency>
+                <dependency>
+                    <code-name-base>com.jme3.gde.project.testdata</code-name-base>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>3.3</specification-version>
+                    </run-dependency>
+                </dependency>
                 <dependency>
                     <code-name-base>org.apache.commons.logging</code-name-base>
                     <build-prerequisite/>

+ 5 - 9
jme3-core/src/com/jme3/gde/core/appstates/NewAppStateWizardAction.java

@@ -92,11 +92,10 @@ public final class NewAppStateWizardAction implements ActionListener {
         if (configuration == null) {
             return null;
         }
-        WizardDescriptor wizardDescriptor = (WizardDescriptor) configuration;
-        ProjectAssetManager manager = (ProjectAssetManager) wizardDescriptor.getProperty("asset_manager");
+        ProjectAssetManager manager = (ProjectAssetManager) configuration.getProperty("asset_manager");
         List<ClassLoader> loaders = manager.getClassLoaders();
 
-        String className = (String) wizardDescriptor.getProperty("class_name");
+        String className = (String) configuration.getProperty("class_name");
         Class clazz = null;
         try {
             clazz = getClass().getClassLoader().loadClass(className);
@@ -112,17 +111,14 @@ public final class NewAppStateWizardAction implements ActionListener {
         }
         if (clazz != null) {
             try {
-                Object contr = clazz.newInstance();
+                Object contr = clazz.getDeclaredConstructor().newInstance();
                 //TODO: remove sillyness-test
                 if (contr instanceof AppState || contr instanceof AbstractAppState) {
                     return (AppState) contr;
                 } else {
                     DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("This is no AppState class!"));
                 }
-            } catch (InstantiationException ex) {
-                Exceptions.printStackTrace(ex);
-                DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error instatiating class!"));
-            } catch (IllegalAccessException ex) {
+            } catch (Exception ex) {
                 Exceptions.printStackTrace(ex);
                 DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error instatiating class!"));
             }
@@ -152,7 +148,7 @@ public final class NewAppStateWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 5 - 7
jme3-core/src/com/jme3/gde/core/appstates/RunAppStateAction.java

@@ -34,9 +34,7 @@ package com.jme3.gde.core.appstates;
 import com.jme3.app.state.AppState;
 import com.jme3.gde.core.assets.ProjectAssetManager;
 import com.jme3.gde.core.scene.FakeApplication;
-import com.jme3.gde.core.scene.PreviewRequest;
 import com.jme3.gde.core.scene.SceneApplication;
-import com.jme3.gde.core.scene.SceneListener;
 import com.jme3.gde.core.scene.SceneRequest;
 import com.sun.source.tree.ClassTree;
 import com.sun.source.tree.CompilationUnitTree;
@@ -44,6 +42,7 @@ import com.sun.source.tree.Tree;
 import java.awt.event.ActionEvent;
 import java.beans.PropertyChangeListener;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.lang.model.element.TypeElement;
@@ -233,8 +232,10 @@ public class RunAppStateAction implements ContextAwareAction {
                     }
                 }
 
+                @Override
                 public void cancel() {
                 }
+                
             };
             src.runUserActionTask(task, true);
             return ret;
@@ -247,13 +248,10 @@ public class RunAppStateAction implements ContextAwareAction {
     private void attachState(FakeApplication app) {
         try {
             assert (config.className != null);
-            AppState state = (AppState) app.getClassByName(config.className).newInstance();
+            AppState state = (AppState) app.getClassByName(config.className).getDeclaredConstructor().newInstance();
             app.getStateManager().attach(state);
             AppStateExplorerTopComponent.openExplorer();
-        } catch (InstantiationException ex) {
-            DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error creating AppState, is the project compiled?\nAlso make sure it has an empty constructor!\n" + ex.getMessage()));
-            Exceptions.printStackTrace(ex);
-        } catch (IllegalAccessException ex) {
+        } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException | SecurityException | InvocationTargetException ex) {
             DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error creating AppState, is the project compiled?\nAlso make sure it has an empty constructor!\n" + ex.getMessage()));
             Exceptions.printStackTrace(ex);
         } catch (Exception ex) {

+ 1 - 1
jme3-core/src/com/jme3/gde/core/assets/AssetDataNode.java

@@ -70,7 +70,7 @@ public class AssetDataNode extends DataNode {
             return sheet;
         }
         
-        Sheet.Set set = sheet.createPropertiesSet();
+        Sheet.Set set = Sheet.createPropertiesSet();
         set.setName("AssetKey");
         set.setDisplayName("Conversion Settings");
         for (Field field : key.getClass().getDeclaredFields()) {

+ 10 - 7
jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java

@@ -69,6 +69,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
     private static final Logger logger = Logger.getLogger(CodelessProjectWizardAction.class.getName());
     private WizardDescriptor.Panel[] panels;
 
+    @Override
     public void performAction() {
         WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
         // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
@@ -91,13 +92,13 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
             FileObject properties = project.createData(CodelessProjectFactory.CONFIG_NAME);
             Properties propertiesObj = new Properties();
             FileLock lock = properties.lock();
-            InputStream in = properties.getInputStream();
-            propertiesObj.load(in);
-            in.close();
+            try (InputStream in = properties.getInputStream()) {
+                propertiesObj.load(in);
+            }
             propertiesObj.setProperty("assets.folder.name", assetsFolder);
-            OutputStream out = properties.getOutputStream(lock);
-            propertiesObj.store(out, "assets properties");
-            out.close();
+            try (OutputStream out = properties.getOutputStream(lock)) {
+                propertiesObj.store(out, "assets properties");
+            }
             lock.releaseLock();
 
             Project theProject = ProjectManager.getDefault().findProject(project);
@@ -134,7 +135,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step
@@ -149,6 +150,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
         return panels;
     }
 
+    @Override
     public String getName() {
         return "External Project Assets..";
     }
@@ -158,6 +160,7 @@ public final class CodelessProjectWizardAction extends CallableSystemAction {
         return null;
     }
 
+    @Override
     public HelpCtx getHelpCtx() {
         return HelpCtx.DEFAULT_HELP;
     }

+ 1 - 1
jme3-core/src/com/jme3/gde/core/editor/nodes/ConnectionStraight.java

@@ -572,7 +572,7 @@ public class ConnectionStraight extends JPanel implements ComponentListener,
 
     @Override
     public void propertyChange(PropertyChangeEvent evt) {
-        mapping = (Object) evt.getSource();
+        mapping = evt.getSource();
         key = "error";
         //key = MaterialUtils.makeKey(mapping, getDiagram().getCurrentTechniqueName());
     }

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java

@@ -106,7 +106,7 @@ public class NewBloomFilterAction extends AbstractNewFilterWizardAction {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewDirectionalLightShadowFilterAction.java

@@ -103,7 +103,7 @@ public class NewDirectionalLightShadowFilterAction extends AbstractNewFilterWiza
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewPointLightShadowFilterAction.java

@@ -102,7 +102,7 @@ public class NewPointLightShadowFilterAction extends AbstractNewFilterWizardActi
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/NewSpotLightShadowFilterAction.java

@@ -103,7 +103,7 @@ public class NewSpotLightShadowFilterAction extends AbstractNewFilterWizardActio
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java

@@ -55,7 +55,7 @@ public final class BloomWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 2
jme3-core/src/com/jme3/gde/core/filters/impl/dlsf/DLSFWizardAction.java

@@ -1,7 +1,6 @@
 
 package com.jme3.gde.core.filters.impl.dlsf;
 
-import com.jme3.gde.core.filters.impl.bloom.BloomWizardPanel1;
 import java.awt.Component;
 import java.awt.Dialog;
 import java.awt.event.ActionEvent;
@@ -56,7 +55,7 @@ public final class DLSFWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/plsf/PLSFWizardAction.java

@@ -54,7 +54,7 @@ public final class PLSFWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 1 - 1
jme3-core/src/com/jme3/gde/core/filters/impl/slsf/SLSFWizardAction.java

@@ -54,7 +54,7 @@ public final class SLSFWizardAction implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 2 - 3
jme3-core/src/com/jme3/gde/core/j2seproject/actions/UpgradeProjectWizardPanel1.java

@@ -17,7 +17,7 @@ public class UpgradeProjectWizardPanel1 implements WizardDescriptor.ValidatingPa
     /**
      * The reference to the project we work on.
      */
-    private Project context;
+    private final Project context;
     
     /**
      * The visual component that displays this panel. If you need to access the
@@ -70,8 +70,7 @@ public class UpgradeProjectWizardPanel1 implements WizardDescriptor.ValidatingPa
 
     @Override
     public void storeSettings(WizardDescriptor wiz) {
-        UpgradeProjectVisualPanel1 pnl = (UpgradeProjectVisualPanel1)component;
-        wiz.putProperty("flatUpgrade", pnl.flatUpgrade());
+        wiz.putProperty("flatUpgrade", component.flatUpgrade());
     }
 
     @Override

+ 11 - 2
jme3-core/src/com/jme3/gde/core/navigator/SceneNavigatorPanel.java

@@ -35,9 +35,10 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
     private Lookup.Result<SceneApplication> applicationResult;
     private final Result<AbstractSceneExplorerNode> nodeSelectionResult;
     //ExplorerNode selection listener, does nothing
-    private LookupListener listener = new LookupListener() {
+    private final LookupListener listener = new LookupListener() {
         private Node selectedNode;
 
+        @Override
         public void resultChanged(LookupEvent ev) {
             Collection collection = nodeSelectionResult.allInstances();
             for (Iterator it = collection.iterator(); it.hasNext();) {
@@ -75,22 +76,27 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
         nodeSelectionResult = Utilities.actionsGlobalContext().lookupResult(AbstractSceneExplorerNode.class);
     }
 
+    @Override
     public Lookup getLookup() {
         return lookup;
     }
 
+    @Override
     public String getDisplayName() {
         return "SceneExplorer";
     }
 
+    @Override
     public String getDisplayHint() {
         return "Hint";
     }
 
+    @Override
     public JComponent getComponent() {
         return this;
     }
 
+    @Override
     public void panelActivated(Lookup lkp) {
         ExplorerUtils.activateActions(explorerManager, true);
         applicationResult = lkp.lookupResult(SceneApplication.class);
@@ -98,6 +104,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
         nodeSelectionResult.addLookupListener(listener);
     }
 
+    @Override
     public void panelDeactivated() {
         ExplorerUtils.activateActions(explorerManager, false);
         applicationResult.removeLookupListener(this);
@@ -108,6 +115,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
     /**
      * result listener for application start
      */
+    @Override
     public void resultChanged(LookupEvent ev) {
 //        System.out.println("Select Thread: " + Thread.currentThread().getName());
         Collection collection = applicationResult.allInstances();
@@ -116,7 +124,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
             if (obj instanceof SceneApplication) {
                 SceneApplication app = (SceneApplication) obj;
                 if (app != null) {
-                    Node node = NodeUtility.createNode(((SceneApplication) app).getRootNode());
+                    Node node = NodeUtility.createNode(app.getRootNode());
                     explorerManager.setRootContext(node);
                     explorerManager.getRootContext().setDisplayName(node.getName());
                     return;
@@ -126,6 +134,7 @@ public class SceneNavigatorPanel extends JPanel implements NavigatorPanel, Looku
         explorerManager.setRootContext(Node.EMPTY);
     }
 
+    @Override
     public ExplorerManager getExplorerManager() {
         return explorerManager;
     }

+ 24 - 23
jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java

@@ -60,8 +60,6 @@ import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
@@ -358,7 +356,7 @@ public class FakeApplication extends SimpleApplication {
     public static class FakeAppStateManager extends AppStateManager {
 
         private AppStateManagerNode node;
-        ArrayList<AppState> states = new ArrayList<AppState>();
+        List<AppState> states = new ArrayList<>();
 
         public FakeAppStateManager(Application app) {
             super(app);
@@ -403,8 +401,7 @@ public class FakeApplication extends SimpleApplication {
     private ScheduledThreadPoolExecutor fakeAppThread = new ScheduledThreadPoolExecutor(1);
 
     public void removeCurrentStates() {
-        for (Iterator<AppState> it = new ArrayList<AppState>(appStateManager.getAddedStates()).iterator(); it.hasNext();) {
-            AppState appState = it.next();
+        for (AppState appState : new ArrayList<AppState>(appStateManager.getAddedStates())) {
             try {
                 appStateManager.detach(appState);
             } catch (Exception e) {
@@ -469,10 +466,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean runQueuedFake() {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 runQueuedTasks();
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -491,11 +491,14 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean updateFake(final float tpf) {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 AudioContext.setAudioRenderer(audioRenderer);
                 appStateManager.update(tpf);
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -516,10 +519,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean renderFake() {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 appStateManager.render(renderManager);
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -540,10 +546,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean updateExternalLogicalState(final Node externalNode, final float tpf) {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {               
                 externalNode.updateLogicalState(tpf);
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -564,10 +573,13 @@ public class FakeApplication extends SimpleApplication {
 
     public boolean updateExternalGeometricState(final Node externalNode) {
         Future<Void> fut = fakeAppThread.submit(new Callable<Void>() {
+            
+            @Override
             public Void call() throws Exception {
                 externalNode.updateGeometricState();
                 return null;
             }
+            
         });
         try {
             fut.get(1, TimeUnit.MINUTES);
@@ -606,8 +618,7 @@ public class FakeApplication extends SimpleApplication {
     private void removeAllStates() {
         try {
             try {
-                for (Iterator<AppState> it = new ArrayList<AppState>(appStateManager.getAddedStates()).iterator(); it.hasNext();) {
-                    AppState appState = it.next();
+                for (AppState appState : new ArrayList<>(appStateManager.getAddedStates())) {
                     appStateManager.detach(appState);
                 }
             } catch (Exception e) {
@@ -631,9 +642,7 @@ public class FakeApplication extends SimpleApplication {
         while (!externalNode.getChildren().isEmpty()) {
             try {
                 externalNode.detachAllChildren();
-            } catch (Exception e) {
-                Exceptions.printStackTrace(e);
-            } catch (Error e) {
+            } catch (Exception | Error e) {
                 Exceptions.printStackTrace(e);
             }
         }
@@ -641,36 +650,28 @@ public class FakeApplication extends SimpleApplication {
         while (control != null) {
             try {
                 externalNode.removeControl(control);
-            } catch (Exception e) {
-                Exceptions.printStackTrace(e);
-            } catch (Error e) {
+            } catch (Exception | Error e) {
                 Exceptions.printStackTrace(e);
             }
             control = externalNode.getControl(Control.class);
         }
         Collection<String> keys = externalNode.getUserDataKeys();
         if (keys != null) {
-            for (Iterator<String> it = keys.iterator(); it.hasNext();) {
-                String string = it.next();
+            for (String string : keys) {
                 externalNode.setUserData(string, null);
             }
         }
         LightList llist = null;
         try {
             llist = externalNode.getLocalLightList();
-            for (Iterator<Light> it = llist.iterator(); it.hasNext();) {
-                Light light = it.next();
+            for (Light light : llist) {
                 try {
                     externalNode.removeLight(light);
-                } catch (Exception e) {
-                    Exceptions.printStackTrace(e);
-                } catch (Error e) {
+                } catch (Exception | Error e) {
                     Exceptions.printStackTrace(e);
                 }
             }
-        } catch (Exception e) {
-            Exceptions.printStackTrace(e);
-        } catch (Error e) {
+        } catch (Exception | Error e) {
             Exceptions.printStackTrace(e);
         }
     }

+ 87 - 6
jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java

@@ -46,12 +46,14 @@ import com.jme3.input.FlyByCamera;
 import com.jme3.input.MouseInput;
 import com.jme3.input.controls.MouseAxisTrigger;
 import com.jme3.input.controls.MouseButtonTrigger;
+import com.jme3.light.LightProbe;
 import com.jme3.light.PointLight;
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.Vector3f;
 import com.jme3.renderer.RenderManager;
 import com.jme3.renderer.ViewPort;
 import com.jme3.renderer.queue.RenderQueue.Bucket;
+import com.jme3.scene.Geometry;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
 import com.jme3.scene.Spatial.CullHint;
@@ -60,6 +62,7 @@ import com.jme3.system.JmeCanvasContext;
 import com.jme3.system.awt.AwtPanel;
 import com.jme3.system.awt.AwtPanelsContext;
 import com.jme3.system.awt.PaintMode;
+import com.jme3.util.SkyFactory;
 import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -134,6 +137,8 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     private Thread thread;
     private NodeSyncAppState nodeSync;
     private FakeApplication fakeApp;
+    private LightProbe pbrLightProbe;
+    private Spatial pbrSky;
 
     public SceneApplication() {
         Logger.getLogger("com.jme3").addHandler(logHandler);
@@ -183,6 +188,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     private void attachPanel() {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 panel.attachTo(true, viewPort, overlayView, guiViewPort);
                 return null;
@@ -334,6 +340,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     }
 
     //TODO: Lookup for Application
+    @Override
     public Lookup createAdditionalLookup(Lookup baseContext) {
         return Lookups.fixed(getApplication());
     }
@@ -348,24 +355,22 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
     }
 
     private void notifyOpen(final SceneRequest opened) {
-        for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-            SceneListener sceneViewerListener = it.next();
+        for (SceneListener sceneViewerListener : listeners) {
             sceneViewerListener.sceneOpened(opened);
         }
     }
 
     private void notifyClose(final SceneRequest closed) {
-        for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-            SceneListener sceneViewerListener = it.next();
+        for (SceneListener sceneViewerListener : listeners) {
             sceneViewerListener.sceneClosed(closed);
         }
     }
 
     public void notifyPreview(final PreviewRequest request) {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
-                for (Iterator<SceneListener> it = listeners.iterator(); it.hasNext();) {
-                    SceneListener sceneViewerListener = it.next();
+                for (SceneListener sceneViewerListener : listeners) {
                     sceneViewerListener.previewCreated(request);
                 }
             }
@@ -388,6 +393,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
         }
         closeScene(currentSceneRequest, request);
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
                 if (request == null) {
                     return;
@@ -418,6 +424,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
                 request.setFakeApp(fakeApp);
                 fakeApp.newAssetManager(manager);
                 enqueue(new Callable() {
+                    @Override
                     public Object call() throws Exception {
                         if (manager != null) {
                             assetManager = manager;
@@ -450,6 +457,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     private void closeScene(final SceneRequest oldRequest, final SceneRequest newRequest) {
         java.awt.EventQueue.invokeLater(new Runnable() {
+            @Override
             public void run() {
                 if (oldRequest == null) {
                     return;
@@ -474,6 +482,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
                 //TODO: state list is not thread safe..
                 fakeApp.removeCurrentStates();
                 enqueue(new Callable() {
+                    @Override
                     public Object call() throws Exception {
                         if (physicsState != null) {
                             physicsState.getPhysicsSpace().removeAll(rootNode);
@@ -548,6 +557,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     public void enableCamLight(final boolean enabled) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (enabled) {
                     rootNode.removeLight(camLight);
@@ -562,6 +572,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     public void enableStats(final boolean enabled) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (enabled) {
                     guiNode.attachChild(statsGuiNode);
@@ -575,6 +586,7 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
 
     public void enableWireFrame(final boolean selected) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (selected) {
                     viewPort.addProcessor(wireProcessor);
@@ -585,9 +597,76 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
             }
         });
     }
+    
+    public void enablePBRProbe(final boolean selected) {
+        if (pbrLightProbe == null) {
+            new Thread() {
+                @Override
+                public void run() {
+                    Spatial s = assetManager.loadModel("com/jme3/gde/core/sceneviewer/pbrenv.j3o");
+                    pbrLightProbe = (LightProbe)s.getLocalLightList().get(0);
+                    s.getLocalLightList().clear();
+                    
+                    enqueue(new Callable<Void>() {
+                        @Override
+                        public Void call() throws Exception {
+                            rootNode.addLight(pbrLightProbe);
+                            return null;
+                        }
+                    });
+                }
+                
+            }.start();
+        } else {
+            enqueue(new Callable<Void>() {
+                @Override
+                public Void call() throws Exception {
+                    if (selected) {
+                        rootNode.addLight(pbrLightProbe);
+                    } else {
+                        rootNode.removeLight(pbrLightProbe);
+                    }
+                    return null;
+                }
+            });
+        }
+    }
+    
+    public void enablePBRSkybox(final boolean selected) {
+        if (pbrSky == null) {
+            new Thread() {
+                @Override
+                public void run() {
+                    pbrSky = SkyFactory.createSky(assetManager, "Textures/Sky/Path.hdr", SkyFactory.EnvMapType.EquirectMap);
+                    
+                    enqueue(new Callable<Void>() {
+                        @Override
+                        public Void call() throws Exception {
+                            rootNode.attachChild(pbrSky);
+                            return null;
+                        }
+                    });
+                }
+                
+            }.start();
+        } else {
+            enqueue(new Callable<Void>() {
+                @Override
+                public Void call() throws Exception {
+                    if (selected) {
+                        rootNode.attachChild(pbrSky);
+                    } else {
+                        pbrSky.removeFromParent();
+                    }
+                    return null;
+                }
+            });
+        }
+    }
 
     public void setPhysicsEnabled(final boolean enabled) {
         enqueue(new Callable() {
+            @Override
             public Object call() throws Exception {
                 if (enabled) {
                     if (physicsState == null) {
@@ -636,7 +715,9 @@ public class SceneApplication extends LegacyApplication implements LookupProvide
         NotifyUtil.show("Error starting OpenGL context!", "Click here to go to troubleshooting web page.", MessageType.EXCEPTION, lst, 0);
         logger.log(Level.INFO, exception.getMessage(), exception);
     }
+    
     private static final ActionListener lst = new ActionListener() {
+        @Override
         public void actionPerformed(ActionEvent e) {
             try {
                 HtmlBrowser.URLDisplayer.getDefault().showURL(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting"));

+ 47 - 58
jme3-core/src/com/jme3/gde/core/scene/controller/SceneToolController.java

@@ -1,12 +1,30 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright (c) 2009-2019 jMonkeyEngine All rights reserved. <p/>
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * <p>Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer. <p/> <p>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. <p/> <p>Neither the name of
+ * 'jMonkeyEngine' nor the names of its contributors may be used to endorse or
+ * promote products derived from this software without specific prior written
+ * permission. <p/> <p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "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 THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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.</p>
  */
 package com.jme3.gde.core.scene.controller;
 
-import com.jme3.app.Application;
-import com.jme3.app.state.AppState;
-import com.jme3.app.state.AppStateManager;
+import com.jme3.app.state.AbstractAppState;
 import com.jme3.asset.AssetManager;
 import com.jme3.bounding.BoundingBox;
 import com.jme3.bounding.BoundingVolume;
@@ -22,7 +40,6 @@ import com.jme3.gde.core.scene.SceneApplication;
 import com.jme3.material.Material;
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.Vector3f;
-import com.jme3.renderer.RenderManager;
 import com.jme3.scene.Geometry;
 import com.jme3.scene.Mesh;
 import com.jme3.scene.Node;
@@ -33,11 +50,12 @@ import com.jme3.scene.debug.WireBox;
 import java.util.concurrent.Callable;
 
 /**
- * This class can be used or extended by other plugins to display
- * standard tools in the tools scene e.g. a cursor etc.
+ * This class can be used or extended by other plugins to display standard tools
+ * in the tools scene e.g. a cursor etc.
+ *
  * @author normenhansen
  */
-public class SceneToolController implements AppState {
+public class SceneToolController extends AbstractAppState {
 
     protected Node toolsNode;
     protected boolean showSelection = false;
@@ -53,7 +71,7 @@ public class SceneToolController implements AppState {
     @SuppressWarnings("LeakingThisInConstructor")
     public SceneToolController(AssetManager manager) {
         this.toolsNode = new Node("ToolsNode");
-        initTools();        
+        initTools();
         SceneApplication.getApplication().getStateManager().attach(this);
     }
 
@@ -104,9 +122,9 @@ public class SceneToolController implements AppState {
         //grid
         grid = new Geometry("grid", new Grid(20, 20, 1.0f));
         grid.setMaterial(grayMat);
-        grid.setLocalTranslation(-10, 0, -10);        
+        grid.setLocalTranslation(-10, 0, -10);
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 toolsNode.attachChild(cursor);
                 return null;
@@ -116,7 +134,7 @@ public class SceneToolController implements AppState {
 
     public void updateSelection(final Spatial spat) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doUpdateSelection(spat);
                 return null;
@@ -147,7 +165,7 @@ public class SceneToolController implements AppState {
     public void rebuildSelectionBox() {
         if (SceneApplication.getApplication().isAwt()) {
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+                @Override
                 public Object call() throws Exception {
                     doUpdateSelection(selected);
                     return null;
@@ -162,7 +180,7 @@ public class SceneToolController implements AppState {
 
     public void setCursorLocation(final Vector3f location) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSetCursorLocation(location);
                 return null;
@@ -172,13 +190,14 @@ public class SceneToolController implements AppState {
 
     public void doSetCursorLocation(Vector3f location) {
         cursor.setLocalTranslation(location);
-        if (camController != null)
+        if (camController != null) {
             camController.doSetCamFocus(location);
+        }
     }
 
     public void snapCursorToSelection() {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSnapCursorToSelection();
                 return null;
@@ -234,7 +253,7 @@ public class SceneToolController implements AppState {
         selectionGeometry.setLocalTransform(geom.getWorldTransform());
         selectionShape = selectionGeometry;
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 toolsNode.attachChild(selectionGeometry);
                 return null;
@@ -263,7 +282,7 @@ public class SceneToolController implements AppState {
             //selectionGeometry.setLocalScale(scale);
 
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+                @Override
                 public Object call() throws Exception {
                     toolsNode.attachChild(selectionShape);
                     return null;
@@ -300,7 +319,7 @@ public class SceneToolController implements AppState {
             selectionGeometry.setLocalTransform(geom.getWorldTransform());
             selectionShape = selectionGeometry;
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+                @Override
                 public Object call() throws Exception {
                     toolsNode.attachChild(selectionGeometry);
                     return null;
@@ -314,7 +333,7 @@ public class SceneToolController implements AppState {
             final Spatial shape = selectionShape;
             selectionShape = null;
             SceneApplication.getApplication().enqueue(new Callable<Void>() {
-
+                @Override
                 public Void call() throws Exception {
                     shape.removeFromParent();
                     return null;
@@ -323,12 +342,14 @@ public class SceneToolController implements AppState {
         }
     }
 
+    @Override
     public void cleanup() {
+        super.cleanup();
         detachSelectionShape();
         final Spatial cursor = this.cursor;
         final Spatial grid = this.grid;
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
-
+            @Override
             public Void call() throws Exception {
                 cursor.removeFromParent();
                 grid.removeFromParent();
@@ -345,7 +366,7 @@ public class SceneToolController implements AppState {
 
     public void setShowSelection(final boolean showSelection) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSetShowSelection(showSelection);
                 return null;
@@ -364,7 +385,7 @@ public class SceneToolController implements AppState {
 
     public void setShowGrid(final boolean showGrid) {
         SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
+            @Override
             public Object call() throws Exception {
                 doSetShowGrid(showGrid);
                 return null;
@@ -388,33 +409,8 @@ public class SceneToolController implements AppState {
         return toolsNode;
     }
 
-    public void initialize(AppStateManager asm, Application aplctn) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public boolean isInitialized() {
-        return true;
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void setEnabled(boolean bln) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public boolean isEnabled() {
-        return true;
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void stateAttached(AppStateManager asm) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void stateDetached(AppStateManager asm) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    public void update(float f) {     
+    @Override
+    public void update(float f) {
         if (selected == null || selectionShape == null) {
             return;
         }
@@ -422,14 +418,7 @@ public class SceneToolController implements AppState {
         selectionShape.setLocalTranslation(selected.getWorldTranslation());
         selectionShape.setLocalRotation(selected.getWorldRotation());
         selectionShape.setLocalScale(selected.getWorldScale());
-        
-    }
-    public void render(RenderManager rm) {
-//        throw new UnsupportedOperationException("Not supported yet.");
-    }
 
-    public void postRender() {
-//        throw new UnsupportedOperationException("Not supported yet.");
     }
 
     public Spatial getSelectedSpatial() {

+ 4 - 0
jme3-core/src/com/jme3/gde/core/sceneviewer/Bundle.properties

@@ -11,3 +11,7 @@ SceneViewerTopComponent.jToggleButton2.AccessibleContext.accessibleName=Ortho /
 SceneViewerTopComponent.jToggleButton1.toolTipText=show post filter effects
 SceneViewerTopComponent.jToggleButton1.text=
 SceneViewerTopComponent.enableOrtho.textO=Ortho.
+SceneViewerTopComponent.enablePBREnv.toolTipText=Toggle a PBR Environment
+SceneViewerTopComponent.enablePBREnv.text=
+SceneViewerTopComponent.enablePBRSky.toolTipText=Toggle the Skybox matching the PBR Environment (stay patient)
+SceneViewerTopComponent.enablePBRSky.text=

+ 44 - 0
jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.form

@@ -96,6 +96,50 @@
             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enableWireframeActionPerformed"/>
           </Events>
         </Component>
+        <Component class="javax.swing.JToggleButton" name="enablePBREnv">
+          <Properties>
+            <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpSmile" type="code"/>
+            </Property>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBREnv.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBREnv.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="focusable" type="boolean" value="false"/>
+            <Property name="horizontalTextPosition" type="int" value="0"/>
+            <Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpSmile" type="code"/>
+            </Property>
+            <Property name="verticalTextPosition" type="int" value="3"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enablePBREnvActionPerformed"/>
+          </Events>
+        </Component>
+        <Component class="javax.swing.JToggleButton" name="enablePBRSky">
+          <Properties>
+            <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpMad" type="code"/>
+            </Property>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBRSky.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/core/sceneviewer/Bundle.properties" key="SceneViewerTopComponent.enablePBRSky.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+            <Property name="focusable" type="boolean" value="false"/>
+            <Property name="horizontalTextPosition" type="int" value="0"/>
+            <Property name="selectedIcon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+              <Connection code="IconList.chimpMad" type="code"/>
+            </Property>
+            <Property name="verticalTextPosition" type="int" value="3"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="enablePBRSkyActionPerformed"/>
+          </Events>
+        </Component>
         <Container class="javax.swing.JPanel" name="jPanel1">
 
           <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>

+ 52 - 1
jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.java

@@ -47,7 +47,8 @@ import org.openide.windows.TopComponent;
 import org.openide.windows.WindowManager;
 
 /**
- * Top component which displays something.
+ * This is the component containing the whole scene/model<br />
+ * It also contains the top bar.
  */
 @ConvertAsProperties(dtd = "-//com.jme3.gde.core.sceneviewer//SceneViewer//EN",
 autostore = false)
@@ -92,8 +93,10 @@ public final class SceneViewerTopComponent extends TopComponent {
         //the oGLPanel may naver have the focus.
         //  if ("true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false"))) {
         addMouseWheelListener(new MouseWheelListener() {
+            @Override
             public void mouseWheelMoved(final MouseWheelEvent e) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                         String action;
                         if (e.getWheelRotation() < 0) {
@@ -113,11 +116,14 @@ public final class SceneViewerTopComponent extends TopComponent {
             }
         });
         addKeyListener(new KeyListener() {
+            @Override
             public void keyTyped(KeyEvent evt) {
             }
 
+            @Override
             public void keyPressed(final KeyEvent evt) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), true, false);
@@ -130,8 +136,10 @@ public final class SceneViewerTopComponent extends TopComponent {
                 });
             }
 
+            @Override
             public void keyReleased(final KeyEvent evt) {
                 SceneApplication.getApplication().enqueue(new Callable<Void>() {
+                    @Override
                     public Void call() throws Exception {
                         int code = AwtKeyInput.convertAwtKey(evt.getKeyCode());
                         KeyInputEvent keyEvent = new KeyInputEvent(code, evt.getKeyChar(), false, false);
@@ -161,6 +169,8 @@ public final class SceneViewerTopComponent extends TopComponent {
         jToggleButton1 = new javax.swing.JToggleButton();
         jSeparator1 = new javax.swing.JToolBar.Separator();
         enableWireframe = new javax.swing.JToggleButton();
+        enablePBREnv = new javax.swing.JToggleButton();
+        enablePBRSky = new javax.swing.JToggleButton();
         jPanel1 = new javax.swing.JPanel();
         enableStats = new javax.swing.JToggleButton();
         oGLPanel = new javax.swing.JPanel();
@@ -211,6 +221,34 @@ public final class SceneViewerTopComponent extends TopComponent {
             }
         });
         jToolBar1.add(enableWireframe);
+
+        enablePBREnv.setIcon(IconList.chimpSmile);
+        org.openide.awt.Mnemonics.setLocalizedText(enablePBREnv, org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBREnv.text")); // NOI18N
+        enablePBREnv.setToolTipText(org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBREnv.toolTipText")); // NOI18N
+        enablePBREnv.setFocusable(false);
+        enablePBREnv.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+        enablePBREnv.setSelectedIcon(IconList.chimpSmile);
+        enablePBREnv.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+        enablePBREnv.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                enablePBREnvActionPerformed(evt);
+            }
+        });
+        jToolBar1.add(enablePBREnv);
+
+        enablePBRSky.setIcon(IconList.chimpMad);
+        org.openide.awt.Mnemonics.setLocalizedText(enablePBRSky, org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBRSky.text")); // NOI18N
+        enablePBRSky.setToolTipText(org.openide.util.NbBundle.getMessage(SceneViewerTopComponent.class, "SceneViewerTopComponent.enablePBRSky.toolTipText")); // NOI18N
+        enablePBRSky.setFocusable(false);
+        enablePBRSky.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+        enablePBRSky.setSelectedIcon(IconList.chimpMad);
+        enablePBRSky.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+        enablePBRSky.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                enablePBRSkyActionPerformed(evt);
+            }
+        });
+        jToolBar1.add(enablePBRSky);
         jToolBar1.add(jPanel1);
 
         enableStats.setIcon(IconList.info);
@@ -248,8 +286,19 @@ public final class SceneViewerTopComponent extends TopComponent {
     private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
         FilterExplorerTopComponent.findInstance().setFilterEnabled(jToggleButton1.isSelected());
     }//GEN-LAST:event_jToggleButton1ActionPerformed
+
+    private void enablePBREnvActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enablePBREnvActionPerformed
+        app.enablePBRProbe(enablePBREnv.isSelected());
+    }//GEN-LAST:event_enablePBREnvActionPerformed
+
+    private void enablePBRSkyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enablePBRSkyActionPerformed
+        app.enablePBRSkybox(enablePBRSky.isSelected());
+    }//GEN-LAST:event_enablePBRSkyActionPerformed
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JToggleButton enableCamLight;
+    private javax.swing.JToggleButton enablePBREnv;
+    private javax.swing.JToggleButton enablePBRSky;
     private javax.swing.JToggleButton enableStats;
     private javax.swing.JToggleButton enableWireframe;
     private javax.swing.JPanel jPanel1;
@@ -264,6 +313,7 @@ public final class SceneViewerTopComponent extends TopComponent {
      * only, i.e. deserialization routines; otherwise you could get a
      * non-deserialized instance. To obtain the singleton instance, use
      * {@link #findInstance}.
+     * @return 
      */
     public static synchronized SceneViewerTopComponent getDefault() {
         if (instance == null) {
@@ -275,6 +325,7 @@ public final class SceneViewerTopComponent extends TopComponent {
     /**
      * Obtain the SceneViewerTopComponent instance. Never call
      * {@link #getDefault} directly!
+     * @return 
      */
     public static synchronized SceneViewerTopComponent findInstance() {
         TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);

BIN
jme3-core/src/com/jme3/gde/core/sceneviewer/pbrenv.j3o


+ 2 - 2
jme3-documentation/nbproject/genfiles.properties

@@ -3,6 +3,6 @@ build.xml.script.CRC32=20380530
 [email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=ded89ea9
+nbproject/build-impl.xml.data.CRC32=83373b13
 nbproject/build-impl.xml.script.CRC32=0cdd5704
-nbproject/[email protected]4.1
+nbproject/[email protected]8

+ 1 - 1
jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/GlslLanguage.java

@@ -45,7 +45,7 @@ import org.netbeans.modules.csl.spi.LanguageRegistration;
 public class GlslLanguage extends DefaultLanguageConfig {
 
     @Override
-    public Language getLexerLanguage() {
+    public Language<GlslTokenID> getLexerLanguage() {
         return new GlslLanguageHierarchy().language();
     }
 

+ 2 - 2
jme3-glsl-highlighter/src/com/jme3/gde/glsl/highlighter/lexer/GlslLexer.java

@@ -46,12 +46,12 @@ import org.netbeans.spi.lexer.TokenFactory;
 public class GlslLexer implements Lexer<GlslTokenID> {
 
     private final LexerInput lexerInput;
-    private final TokenFactory tokenFactory;
+    private final TokenFactory<GlslTokenID> tokenFactory;
     private final Logger log = Logger.getLogger(this.getClass().getCanonicalName());
 
     private String thisLineSoFar = "";
 
-    public GlslLexer(LexerRestartInfo info) {
+    public GlslLexer(LexerRestartInfo<GlslTokenID> info) {
         lexerInput = info.input();
         tokenFactory = info.tokenFactory();
     }

+ 1 - 2
jme3-gui/src/com/jme3/gde/gui/NiftyGuiDataObject.java

@@ -114,8 +114,7 @@ public class NiftyGuiDataObject extends MultiDataObject {
                             return;
                         }
                     }
-                } catch (IOException ex) {
-                } catch (IllegalArgumentException ex) {
+                } catch (IOException | IllegalArgumentException ex) {
                 }
             }
             file = file.getParent();

+ 8 - 11
jme3-gui/src/com/jme3/gde/gui/swing/ConvertToNifty.java

@@ -2,25 +2,22 @@ package com.jme3.gde.gui.swing;
 
 import com.jme3.gde.core.assets.ProjectAssetManager;
 import com.jme3.gde.core.util.ProjectSelection;
-import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.IOException;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.Iterator;
-import java.util.LinkedList;
+import java.util.ArrayList;
 import java.util.List;
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.api.java.project.JavaProjectConstants;
 import org.netbeans.api.project.Project;
-
 import org.netbeans.api.project.SourceGroup;
-
 import org.netbeans.api.project.Sources;
-import org.openide.awt.ActionRegistration;
+import org.openide.awt.ActionID;
 import org.openide.awt.ActionReference;
 import org.openide.awt.ActionReferences;
-import org.openide.awt.ActionID;
+import org.openide.awt.ActionRegistration;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
 import org.openide.util.Exceptions;
@@ -42,6 +39,7 @@ public final class ConvertToNifty implements ActionListener {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
         if (pm == null) {
@@ -60,13 +58,12 @@ public final class ConvertToNifty implements ActionListener {
 
         Sources sources = context.getLookup().lookup(Sources.class);
         if (sources != null) {
-            List<URL> urls = new LinkedList<URL>();
+            List<URL> urls = new ArrayList<>();
             SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
             for (SourceGroup sourceGroup : groups) {
                 try {
                     ClassPath path = ClassPath.getClassPath(sourceGroup.getRootFolder(), ClassPath.COMPILE);
-                    for (Iterator<ClassPath.Entry> it = path.entries().iterator(); it.hasNext();) {
-                        ClassPath.Entry entry = it.next();
+                    for (ClassPath.Entry entry : path.entries()) {
                         urls.add(entry.getURL());
                     }
                 } catch (Exception ex) {
@@ -83,7 +80,7 @@ public final class ConvertToNifty implements ActionListener {
                     clazzConfig.getDeclaredMethod("setOutputDir", clazzString).invoke(null, folder.getPath());
                     Object string = clazzString.getDeclaredConstructor(clazzString).newInstance(sourceGroup.getRootFolder().getPath());//context.getProjectDirectory().getFileObject("build/classes").getPath());
                     Object file = clazzFile.getDeclaredConstructor(clazzString).newInstance(string);
-                    Object factory = clazzFactory.newInstance();
+                    Object factory = clazzFactory.getDeclaredConstructor().newInstance();
                     clazzFactory.getMethod("loadComponents", clazzFile).invoke(factory, file);
                 } catch (Exception ex) {
                     Exceptions.printStackTrace(ex);

+ 15 - 27
jme3-gui/src/com/jme3/gde/gui/view/NiftyGuiVisualElement.java

@@ -78,10 +78,10 @@ import org.xml.sax.SAXException;
 @SuppressWarnings({"unchecked", "rawtypes"})
 public final class NiftyGuiVisualElement extends JPanel implements MultiViewElement , ExplorerManager.Provider,Observer, PropertyChangeListener {
     private static final Logger logger = Logger.getLogger(NiftyGuiVisualElement.class.getName());
-    private NiftyGuiDataObject obj;
-    private JToolBar toolbar = new JToolBar();
+    private final NiftyGuiDataObject obj;
+    private final JToolBar toolbar = new JToolBar();
     private transient MultiViewElementCallback callback;
-    private GUIEditor editor;
+    private final GUIEditor editor;
     private final Nifty nifty;
     private final J2DNiftyView view;
     private final JComboBox layers = new JComboBox();
@@ -89,13 +89,14 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
     private final UndoRedo.Manager undoSupport;
     private int guiID;
      private final InstanceContent content = new InstanceContent();
-     private Lookup lookup;
-     private AssetManager assetManager;
+     private final Lookup lookup;
+     private final AssetManager assetManager;
 
     protected class ResourceLocationJmp implements ResourceLocation {
 
+        @Override
         public InputStream getResourceAsStream(String path) {
-            AssetKey<Object> key = new AssetKey<Object>(path);
+            AssetKey<Object> key = new AssetKey<>(path);
             AssetInfo info = assetManager.locateAsset(key);
             if (info != null){
                 return info.openStream();
@@ -104,12 +105,13 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
             }
         }
 
+        @Override
         public URL getResource(String path) {
             throw new UnsupportedOperationException();
         }
     }
     
-    private ResourceLocation resourceLocation = new ResourceLocationJmp();
+    private final ResourceLocation resourceLocation = new ResourceLocationJmp();
     
         
     public NiftyGuiVisualElement(Lookup lkp) {
@@ -151,6 +153,7 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
         JComboBox comboBox = new JComboBox(new String[]{"640x480", "480x800", "800x480", "800x600", "1024x768", "1280x720"});
         comboBox.addItemListener(new ItemListener() {
 
+            @Override
             public void itemStateChanged(ItemEvent e) {
                 String string = (String) e.getItem();
                 if ("640x480".equals(string)) {
@@ -175,6 +178,7 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
         toolbar.add(new JLabel("Current Layer"));
         layers.addItemListener(new ItemListener() {
 
+            @Override
             public void itemStateChanged(ItemEvent e) {
                 GLayer item = (GLayer) e.getItem();
                 editor.selectElement(item);
@@ -254,12 +258,8 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
         String path = this.obj.getPrimaryFile().getPath();
         try {
             this.editor.saveGui(path);
-        } catch (FileNotFoundException ex) {
+        } catch (FileNotFoundException | JAXBException | NullPointerException ex) {
             Exceptions.printStackTrace(ex);
-        } catch (JAXBException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (NullPointerException ex){
-             Exceptions.printStackTrace(ex);
         }
     }
 
@@ -349,22 +349,14 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
             Collection<GLayer> layers1 = this.editor.getGui().getLayers();
             guiID = this.editor.getGui().getGUIid();
             this.editor.getGui().addObserver(this);
-            DefaultComboBoxModel<GLayer> model = new DefaultComboBoxModel<GLayer>(layers1.toArray(new GLayer[0]));
+            DefaultComboBoxModel<GLayer> model = new DefaultComboBoxModel<>(layers1.toArray(new GLayer[0]));
             layers.setModel(model);
             layers.setSelectedItem(this.editor.getCurrentLayer());
             
             handle.finish();
         } catch (ParserConfigurationException ex) {
             Exceptions.printStackTrace(ex);
-        } catch (JAXBException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ClassNotFoundException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (IOException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (NoProductException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (SAXException ex) {
+        } catch (JAXBException | ClassNotFoundException | IOException | NoProductException | SAXException ex) {
             Exceptions.printStackTrace(ex);
         } catch (Exception ex) {
             Exceptions.printStackTrace(ex);
@@ -402,11 +394,7 @@ public final class NiftyGuiVisualElement extends JPanel implements MultiViewElem
             NiftyGuiVisualElement.this.content.remove(this);
           
             
-        } catch (FileNotFoundException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (JAXBException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ClassNotFoundException ex) {
+        } catch (FileNotFoundException | JAXBException | ClassNotFoundException ex) {
             Exceptions.printStackTrace(ex);
         }
     }

+ 12 - 2
jme3-ios/ios-data/templates/ios.properties

@@ -48,7 +48,17 @@ ios.proguard.options=-keep public class com.jme3.system.ios.*{public *;} \
 -keep public class * implements javax.xml.parsers.SAXParserFactory{public *;} \
 -keep public class com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl \
 -keep public class com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl \
--keep public class sun.nio.fs.MacOSXFileSystemProvider
+-keep public class sun.nio.fs.MacOSXFileSystemProvider \
+-keep public class * extends java.nio.charset.Charset { *; } \
+-keep public class java.util.zip.Deflater { *; } \
+-keep public class java.io.FileNotFoundException { *; } \
+-keep public class java.lang.reflect.Proxy { *; } \
+-keep public class java.lang.reflect.InvocationHandler { *; } \
+-keep public class java.util.logging.ConsoleHandler \
+-keep public class java.util.logging.FileHandler \
+-keep public class java.util.logging.SimpleFormatter \
+-keep public class java.util.logging.LogManager { *; } \
+-keep public class org.xmlpull.mxp1.MXParserFactory { *; }
 
 # native compile
 ios.cc.source.dir=ios/src
@@ -57,7 +67,7 @@ ios.cc.compiler=clang
 ios.cc.cflags=-D__IPHONE_OS_VERSION_MIN_REQUIRED=30202 \
 -fobjc-abi-version=2 -fobjc-legacy-dispatch \
 -I/System/Library/Frameworks/JavaVM.framework/Headers \
--I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Headers/
+-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/
 
 # arm/i386 section, resolved in build file to ios.avian.bootimage-generator etc.
 ios.avian.path.arm=${ios.avian.path}/avian-arm

+ 99 - 21
jme3-ios/ios-data/templates/project/jme-ios.xcodeproj/project.pbxproj

@@ -163,7 +163,8 @@
 		08914BFB142A826B00991C80 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				ORGANIZATIONNAME = "ECOVATE INC, d.b.a. ReadyTalk";
+				LastUpgradeCheck = 1130;
+				ORGANIZATIONNAME = jmonkeyengine.org;
 				TargetAttributes = {
 					08914C03142A826B00991C80 = {
 						DevelopmentTeam = X9TVYA7QX5;
@@ -175,6 +176,7 @@
 			developmentRegion = English;
 			hasScannedForEncodings = 0;
 			knownRegions = (
+				English,
 				en,
 			);
 			mainGroup = 08914BF9142A826B00991C80;
@@ -247,11 +249,31 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"DEBUG=1",
@@ -259,26 +281,33 @@
 				);
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				GCC_VERSION = "";
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
 					/System/Library/Frameworks/JavaVM.framework/Headers,
-					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
+					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = (
 					"-filelist",
 					"../../build/ios-arm/libs.list",
 					"-filelist",
 					"../../build/ios-arm64/libs.list",
 					"-filelist",
-					"../../build/ios-i386/libs.list",
+					"../../build/ios-x86_64/libs.list",
 					"-lz",
 					"-rdynamic",
+					"-force_cpusubtype_ALL",
 				);
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
+				VALID_ARCHS = "armv7 arm64 x86_64";
 			};
 			name = Debug;
 		};
@@ -286,19 +315,42 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = YES;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_VERSION = "";
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
 					/System/Library/Frameworks/JavaVM.framework/Headers,
-					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
+					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
 				OTHER_LDFLAGS = (
 					"-filelist",
@@ -306,36 +358,50 @@
 					"-filelist",
 					"../../build/ios-arm64/libs.list",
 					"-filelist",
-					"../../build/ios-i386/libs.list",
+					"../../build/ios-x86_64/libs.list",
 					"-lz",
 					"-rdynamic",
+					"-force_cpusubtype_ALL",
 				);
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				VALIDATE_PRODUCT = YES;
+				VALID_ARCHS = "armv7 arm64 x86_64";
 			};
 			name = Release;
 		};
 		08914C2B142A826B00991C80 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = (
-					armv7,
-					i386,
-				);
+				CLANG_ENABLE_OBJC_WEAK = YES;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				DEVELOPMENT_TEAM = X9TVYA7QX5;
+				ENABLE_BITCODE = NO;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "jme-ios/jme-ios-Prefix.pch";
 				GCC_VERSION = "";
 				HEADER_SEARCH_PATHS = (
 					/System/Library/Frameworks/JavaVM.framework/Headers,
-					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
+					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
 				);
 				INFOPLIST_FILE = "jme-ios/jme-ios-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				OTHER_LDFLAGS = (
+					"-filelist",
+					"../../build/ios-arm/libs.list",
+					"-filelist",
+					"../../build/ios-arm64/libs.list",
+					"-filelist",
+					"../../build/ios-x86_64/libs.list",
+					"-lz",
+					"-rdynamic",
+					"-force_cpusubtype_ALL",
+				);
+				PRODUCT_BUNDLE_IDENTIFIER = "com.jmonkeyengine.jme-ios";
 				PRODUCT_NAME = "jme-ios";
 				PROVISIONING_PROFILE = "";
+				VALID_ARCHS = "armv7 arm64 x86_64";
 				WRAPPER_EXTENSION = app;
 			};
 			name = Debug;
@@ -343,23 +409,35 @@
 		08914C2C142A826B00991C80 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = (
-					armv7,
-					i386,
-				);
+				CLANG_ENABLE_OBJC_WEAK = YES;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				DEVELOPMENT_TEAM = X9TVYA7QX5;
+				ENABLE_BITCODE = NO;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "jme-ios/jme-ios-Prefix.pch";
 				GCC_VERSION = "";
 				HEADER_SEARCH_PATHS = (
 					/System/Library/Frameworks/JavaVM.framework/Headers,
-					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
+					/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Headers/,
 				);
 				INFOPLIST_FILE = "jme-ios/jme-ios-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				OTHER_LDFLAGS = (
+					"-filelist",
+					"../../build/ios-arm/libs.list",
+					"-filelist",
+					"../../build/ios-arm64/libs.list",
+					"-filelist",
+					"../../build/ios-x86_64/libs.list",
+					"-lz",
+					"-rdynamic",
+					"-force_cpusubtype_ALL",
+				);
+				PRODUCT_BUNDLE_IDENTIFIER = "com.jmonkeyengine.jme-ios";
 				PRODUCT_NAME = "jme-ios";
 				PROVISIONING_PROFILE = "";
+				VALID_ARCHS = "armv7 arm64 x86_64";
 				WRAPPER_EXTENSION = app;
 			};
 			name = Release;

+ 5 - 1
jme3-ios/ios-data/templates/project/jme-ios/jme-ios-Info.plist

@@ -11,7 +11,7 @@
 	<key>CFBundleIconFile</key>
 	<string></string>
 	<key>CFBundleIdentifier</key>
-	<string>com.jmonkeyengine.${PRODUCT_NAME:rfc1034identifier}</string>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
@@ -30,6 +30,8 @@
 	<string>MainWindow_iPhone</string>
 	<key>NSMainNibFile~ipad</key>
 	<string>MainWindow_iPad</string>
+	<key>UIStatusBarHidden</key>
+	<true/>
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
@@ -43,5 +45,7 @@
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+	<key>UIViewControllerBasedStatusBarAppearance</key>
+	<false/>
 </dict>
 </plist>

+ 36 - 21
jme3-ios/ios-data/templates/project/jme-ios/jmeAppDelegate.m

@@ -273,13 +273,18 @@ getEnv(JavaVM* vm)
     NSLog(@"touchesBegan");
     JNIEnv* e = getEnv(self.vm);
     if (e) {
-    	UITouch *touch = [touches anyObject];
-    	CGPoint position = [touch locationInView: nil];
-        (*e)->CallVoidMethod(e, self.harness, self.injectTouchBegin, 0, touch.timestamp, position.x, position.y);
-        if ((*e)->ExceptionCheck(e)) {
-            NSLog(@"Could not invoke iOS Harness injectTouchBegin");
-            (*e)->ExceptionDescribe(e);
-            (*e)->ExceptionClear(e);
+        NSEnumerator *enumerator = [touches objectEnumerator];
+        UITouch *touch;
+        while (touch = [enumerator nextObject]) {
+            CGPoint position = [touch locationInView: nil];
+            float scale = _glview.contentScaleFactor;
+            // NOTE: cast to jlong is required, otherwise JmeAppHarness receives non-sense values
+            (*e)->CallVoidMethod(e, self.harness, self.injectTouchBegin, (jint) touch.hash, (jlong) touch.timestamp, position.x * scale, position.y * scale);
+            if ((*e)->ExceptionCheck(e)) {
+                NSLog(@"Could not invoke iOS Harness injectTouchBegin");
+                (*e)->ExceptionDescribe(e);
+                (*e)->ExceptionClear(e);
+            }
         }
     }
 }
@@ -288,13 +293,18 @@ getEnv(JavaVM* vm)
     NSLog(@"touchesMoved");
     JNIEnv* e = getEnv(self.vm);
     if (e) {
-    	UITouch *touch = [touches anyObject];
-    	CGPoint position = [touch locationInView: nil];
-        (*e)->CallVoidMethod(e, self.harness, self.injectTouchMove, 0, touch.timestamp, position.x, position.y);
-        if ((*e)->ExceptionCheck(e)) {
-            NSLog(@"Could not invoke iOS Harness injectTouchMove");
-            (*e)->ExceptionDescribe(e);
-            (*e)->ExceptionClear(e);
+        NSEnumerator *enumerator = [touches objectEnumerator];
+        UITouch *touch;
+        while (touch = [enumerator nextObject]) {
+            CGPoint position = [touch locationInView: nil];
+            float scale = _glview.contentScaleFactor;
+            // NOTE: cast to jlong is required, otherwise JmeAppHarness receives non-sense values
+            (*e)->CallVoidMethod(e, self.harness, self.injectTouchMove, (jint) touch.hash, (jlong) touch.timestamp, position.x * scale, position.y * scale);
+            if ((*e)->ExceptionCheck(e)) {
+                NSLog(@"Could not invoke iOS Harness injectTouchMove");
+                (*e)->ExceptionDescribe(e);
+                (*e)->ExceptionClear(e);
+            }
         }
     }
 }
@@ -303,13 +313,18 @@ getEnv(JavaVM* vm)
     NSLog(@"touchesEnded");
     JNIEnv* e = getEnv(self.vm);
     if (e) {
-    	UITouch *touch = [touches anyObject];
-    	CGPoint position = [touch locationInView: nil];
-        (*e)->CallVoidMethod(e, self.harness, self.injectTouchEnd, 0, touch.timestamp, position.x, position.y);
-        if ((*e)->ExceptionCheck(e)) {
-            NSLog(@"Could not invoke iOS Harness injectTouchEnd");
-            (*e)->ExceptionDescribe(e);
-            (*e)->ExceptionClear(e);
+        NSEnumerator *enumerator = [touches objectEnumerator];
+        UITouch *touch;
+        while (touch = [enumerator nextObject]) {
+            CGPoint position = [touch locationInView: nil];
+            float scale = _glview.contentScaleFactor;
+            // NOTE: cast to jlong is required, otherwise JmeAppHarness receives non-sense values
+            (*e)->CallVoidMethod(e, self.harness, self.injectTouchEnd, (jint) touch.hash, (jlong) touch.timestamp, position.x * scale, position.y * scale);
+            if ((*e)->ExceptionCheck(e)) {
+                NSLog(@"Could not invoke iOS Harness injectTouchEnd");
+                (*e)->ExceptionDescribe(e);
+                (*e)->ExceptionClear(e);
+            }
         }
     }
 }

+ 28 - 1
jme3-ios/ios-data/templates/project/jme-ios/logging.properties

@@ -1 +1,28 @@
-.level = FINEST
+# NOTE: If this file has no effect, add this line to your app:
+#       Class.forName("java.util.logging.LoggingProxyImpl");
+
+.level = FINEST
+#.level = OFF
+
+#com.mycompany.mygame.level = ALL
+#com.mycompany.mygame.level = INFO
+
+#handlers = handler1, handler2, handler3
+
+#handlers = com.jme3.system.ios.IosLogHandler
+# NOTE: IosLogHandler is always present, logs to System.err and is not configurable.
+#       Therefore you will see each log twice if you add another handler.
+
+#handlers = java.util.logging.ConsoleHandler
+#java.util.logging.ConsoleHandler.level = ALL
+#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+#handlers = java.util.logging.FileHandler
+#java.util.logging.FileHandler.level = ALL
+#java.util.logging.FileHandler.pattern = /tmp/mygame.log
+#java.util.logging.FileHandler.limit = 50000000
+#java.util.logging.FileHandler.count = 1
+#java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+# http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax
+#java.util.logging.SimpleFormatter.format = %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %2$s %5$s%6$s%n

+ 0 - 477
jme3-ios/ios-data/templates/src/com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.c

@@ -1,477 +0,0 @@
-#include "com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.h"
-#include "OpenAL/alc.h"
-#include "OpenAL/al.h"
-//#include "OpenAL/alext.h"
-#include "OpenAL/oalMacOSX_OALExtensions.h"
-// for fprintf(stderr, "YourApp", "formatted message");
-// #include <android/log.h>
-#include <jni.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-#include <time.h>
-
-
-static jboolean created = JNI_FALSE;
-
-#define BUFFER_COUNT 1
-ALuint* buffers[BUFFER_COUNT] = { 0 };
-ALuint* source = 0;
-
-int getError() {
-    int errorcode = alGetError();
-//    fprintf(stderr, "getError: %d", errorcode);
-    return errorcode;
-}
-
-/* InitAL opens the default device and sets up a context using default
- * attributes, making the program ready to call OpenAL functions. */
-int InitAL()
-{
-    ALCdevice *device;
-    ALCcontext *ctx;
-
-    /* Open and initialize a device with default settings */
-    device = alcOpenDevice(NULL);
-    if(!device)
-    {
-        fprintf(stderr, "Could not open a device!\n");
-        return 1;
-    }
-
-    ctx = alcCreateContext(device, NULL);
-    fprintf(stderr, "NULL: %d", NULL);
-    fprintf(stderr, "Created context: %d", ctx);
-    fprintf(stderr, "Created context addr: %d", &ctx);
-    if(ctx == NULL || alcMakeContextCurrent(ctx) == ALC_FALSE)
-    {
-        if(ctx != NULL)
-            alcDestroyContext(ctx);
-        alcCloseDevice(device);
-        fprintf(stderr, "Could not set a context!\n");
-        return 1;
-    }
-
-    printf("Opened \"%s\"\n", alcGetString(device, ALC_DEVICE_SPECIFIER));
-    fprintf(stderr, "Opened %s", alcGetString(device, ALC_DEVICE_SPECIFIER));
-    return 0;
-}
-
-/* CloseAL closes the device belonging to the current context, and destroys the
- * context. */
-void CloseAL()
-{
-    ALCdevice *device;
-    ALCcontext *ctx;
-    ALCboolean result;
-
-//    fprintf(stderr, "Getting current context");
-    ctx = alcGetCurrentContext();
-//    getError();
-    if(ctx == NULL){
-        fprintf(stderr, "No context found");
-        return;
-    }
-
-//    fprintf(stderr, "Getting current context device");
-    device = alcGetContextsDevice(ctx);
-    if(device == NULL) {
-        fprintf(stderr, "No device found");
-        return;
-    } else {
-        fprintf(stderr, "alcGetContextsDevice device: %d", device);
-        fprintf(stderr, "alcGetContextsDevice device addr: %d", &device);
-    }
-//    getError();
-
-//    fprintf(stderr, "Setting context to NULL");
-    result = alcMakeContextCurrent(NULL);
-//    fprintf(stderr, "alcMakeContextCurrent returned");
-//    fprintf(stderr, "alcMakeContextCurrent returned with result: %d", result);
-    if(!result) {
-        fprintf(stderr, "alcMakeContextCurrent failed");
-        return;
-    }
-
-//    fprintf(stderr, "Destroying context: %d", ctx);
-//    fprintf(stderr, "Destroying context addr: %d", &ctx);
-    alcDestroyContext(ctx);
-
-//    fprintf(stderr, "Closing device");
-    result = alcCloseDevice(device);
-//    fprintf(stderr, "alcCloseDevice result: %d", result);
-}
-
-
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alIsCreated
-  (JNIEnv* env, jclass cl)
-{
-    return created;
-}
-
-
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alCreate
-  (JNIEnv* env, jclass cl)
-{
-//    fprintf(stderr, "Starting Audio Engine");
-
-    InitAL();
-    created = JNI_TRUE;
-    return created;
-
-}
-
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDestroy
-  (JNIEnv* env, jclass cl)
-{
-
-//    fprintf(stderr, "alDestroy");
-    CloseAL();
-    created = JNI_FALSE;
-    return created;
-
-}
-
-JNIEXPORT jstring JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alcGetString
-  (JNIEnv* env, jclass cl, jint param)
-{
-//    fprintf(stderr, "alcGetString for param: %d", param);
-
-    ALCdevice *device;
-    ALCcontext *ctx;
-
-    ctx = alcGetCurrentContext();
-    if(ctx != NULL) {
-        device = alcGetContextsDevice(ctx);
-//        fprintf(stderr, "alcGetString param value: %s", alcGetString(device, param));
-        return (*env)->NewStringUTF(env, alcGetString(device, param));
-    }
-}
-
-JNIEXPORT jstring JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGetString
-  (JNIEnv* env, jclass cl, jint param)
-{
-//    fprintf(stderr, "alGetString for param: %d", param);
-//    fprintf(stderr, "alGetString param value: %s", alGetString(param));
-    return (*env)->NewStringUTF(env, alGetString(param));
-}
-
-JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenSources
-  (JNIEnv *env, jclass cl)
-{
-    ALuint source;
-    alGenSources(1, &source);
-//    fprintf(stderr, "alGenSources: %d", source);
-    return source;
-}
-
-JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGetError
-  (JNIEnv *env, jclass cl)
-{
-    return getError();
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteSources
-  (JNIEnv* env, jclass cl, jint numSources, jobject intbufSources)
-{
-//    fprintf(stderr, "alDeleteSources numSources: %d", numSources);
-
-    ALuint* pIntBufSources = (ALuint*) (*env)->GetDirectBufferAddress(env, intbufSources);
-    alDeleteSources((ALsizei)numSources, pIntBufSources);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenBuffers
-  (JNIEnv* env, jclass cl, jint numBuffers, jobject intbufBuffers)
-{
-    ALuint* pIntBufBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, intbufBuffers);
-    alGenBuffers((ALsizei)numBuffers, pIntBufBuffers);
-//    for (int i=0; i<numBuffers; i++) {
-//        fprintf(stderr, "alGenBuffers[%d]: %d", i, *(pIntBufBuffers+i));
-//    }
-
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteBuffers
-  (JNIEnv* env, jclass cl, jint numBuffers, jobject intbufBuffers)
-{
-//    fprintf(stderr, "alDeleteBuffers numBuffers: %d", numBuffers);
-
-    ALuint* pIntBufBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, intbufBuffers);
-//    fprintf(stderr, "alDeleteBuffers Buffers: %d", *pIntBufBuffers);
-//    for (int i=0; i<numBuffers; i++) {
-//        if(alIsBuffer(*(pIntBufBuffers+i)) == AL_TRUE) {
-//            fprintf(stderr, "alDeleteBuffers[%d]: %d", i, *(pIntBufBuffers+i));
-//            fprintf(stderr, "alDeleteBuffers buffer is a known buffer");
-//        }
-//    }
-    alDeleteBuffers((ALsizei)numBuffers, pIntBufBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourceStop
-  (JNIEnv *env, jclass cl, jint source)
-{
-//    fprintf(stderr, "alSourceStop for source: %d", source);
-    alSourceStop((ALuint)source);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcei
-  (JNIEnv *env, jclass cl, jint source, jint param, jint value)
-{
-//    fprintf(stderr, "alSourcei for source: %d, param: %d, value: %d", source, param, value);
-    alSourcei((ALuint)source, (ALenum)param, (ALint)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alBufferData
-  (JNIEnv* env, jclass cö, jint buffer, jint format, jobject bufferData, jint bufferSize, jint frequency)
-{
-//    fprintf(stderr, "alBufferData for source: %d, format: %d, size: %d, frequency: %d", buffer, format, bufferSize, frequency);
-    ALuint* pBufferData = (ALuint*) (*env)->GetDirectBufferAddress(env, bufferData);
-    alBufferData((ALuint)buffer, (ALenum)format, pBufferData, (ALsizei)bufferSize, (ALsizei)frequency);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcePlay
-  (JNIEnv *env, jclass cl, jint source)
-{
-//    fprintf(stderr, "alSourcePlay for source: %d", source);
-    alSourcePlay((ALuint)source);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcePause
-  (JNIEnv *env, jclass cl, jint source)
-{
-//    fprintf(stderr, "alSourcePause for source: %d", source);
-    alSourcePause((ALuint)source);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcef
-  (JNIEnv *env, jclass cl, jint source, jint param, jfloat value)
-{
-//    fprintf(stderr, "alSourcef for source: %d, param: %d, value: %f", source, param, value);
-    alSourcef((ALuint)source, (ALenum)param, (ALfloat)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSource3f
-  (JNIEnv *env, jclass cl, jint source, jint param, jfloat value1, jfloat value2, jfloat value3)
-{
-//    fprintf(stderr, "alSource3f for source: %d, param: %d, value1: %f, value2: %f, value3: %f", source, param, value1, value2, value3);
-    alSource3f((ALuint)source, (ALenum)param, (ALfloat)value1, (ALfloat)value2, (ALfloat)value3);
-}
-
-JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGetSourcei
-  (JNIEnv *env, jclass cl, jint source, jint param)
-{
-//    fprintf(stderr, "alGetSourcei for source: %d, param: %d", source, param);
-    ALint result;
-    alGetSourcei((ALuint)source, (ALenum)param, &result);
-    return (jint)result;
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourceUnqueueBuffers
-  (JNIEnv* env, jclass cl, jint source, jint numBuffers, jobject buffers)
-{
-//    fprintf(stderr, "alSourceUnqueueBuffers for source: %d, numBuffers: %d", source, numBuffers);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffers);
-
-//    for (ALuint i=0; i<numBuffers; i++) {
-//        fprintf(stderr, "alSourceUnqueueBuffers, checking buffer[%d]: %d", i, *(pBuffers+i));
-//        ALboolean isBuffer = alIsBuffer(*(pBuffers+i));
-//        fprintf(stderr, "buffer check result: %d", isBuffer);
-//    }
-    alSourceUnqueueBuffers((ALuint)source, (ALsizei)numBuffers, pBuffers);
-//    for (ALuint i=0; i<numBuffers; i++) {
-//        fprintf(stderr, "alSourceUnqueueBuffers[%d]: %d", i, *(pBuffers+i));
-//    }
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourceQueueBuffers
-  (JNIEnv* env, jclass cl, jint source, jint numBuffers, jobject buffers)
-{
-//    fprintf(stderr, "alSourceQueueBuffers for source: %d, numBuffers: %d", source, numBuffers);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffers);
-    alSourceQueueBuffers((ALuint)source, (ALsizei)numBuffers, pBuffers);
-//    for (ALuint i=0; i<numBuffers; i++) {
-//        fprintf(stderr, "alSourceQueueBuffers[%d]: %d", i, *(pBuffers+i));
-//    }
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alListener
-  (JNIEnv* env, jclass cl, jint param, jobject bufferData)
-{
-//    fprintf(stderr, "alListener for param: %d", param);
-    ALfloat* pBufferData = (ALfloat*) (*env)->GetDirectBufferAddress(env, bufferData);
-    alListenerfv((ALenum)param, pBufferData);
-//    getError();
-//    for (int i=0; i<4; i++) {
-//        fprintf(stderr, "alListener[%d]: %f", i, *(pBufferData+(i*sizeof(ALfloat))));
-//    }
-
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alListenerf
-  (JNIEnv *env, jclass cl, jint param, jfloat value)
-{
-//    fprintf(stderr, "alListenerf for param: %d, value: %f", param, value);
-    alListenerf((ALenum)param, (ALfloat)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alListener3f
-  (JNIEnv *env, jclass cl, jint param, jfloat value1, jfloat value2, jfloat value3)
-{
-//    fprintf(stderr, "alListener3f for param: %d, value1: %f, value2: %f, value3: %f", param, value1, value2, value3);
-    alListener3f((ALenum)param, (ALfloat)value1, (ALfloat)value2, (ALfloat)value3);
-}
-
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alcIsExtensionPresent
-  (JNIEnv* env, jclass cl, jstring extension)
-{
-
-    ALCdevice *device;
-    ALCcontext *ctx;
-    ALboolean result;
-//    char buf[128];
-    const char* strExtension;
-    jsize strLength = (*env)->GetStringUTFLength(env, extension);
-
-    ctx = alcGetCurrentContext();
-    if(ctx != NULL) {
-        device = alcGetContextsDevice(ctx);
-
-        if (device != NULL) {
-            strExtension = (*env)->GetStringUTFChars(env, extension, NULL);
-            if (strExtension == NULL) {
-                return JNI_FALSE; /* OutOfMemoryError already thrown */
-            }
-//            fprintf(stderr, "alcIsExtensionPresent for param: %s with size: %d", strExtension, strLength);
-
-            result = alcIsExtensionPresent(device, strExtension);
-//            fprintf(stderr, "alcIsExtensionPresent found: %d", result);
-
-            (*env)->ReleaseStringUTFChars(env, extension, strExtension);
-
-            return (jboolean)result;
-        } else {
-            fprintf(stderr, "device is null in alcIsExtensionPresent");
-        }
-
-    } else {
-        fprintf(stderr, "current context is null in alcIsExtensionPresent");
-    }
-
-    return JNI_FALSE;
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alcGetInteger
-  (JNIEnv* env, jclass cl, jint param, jobject buffer, jint bufferSize)
-{
-    ALCdevice *device;
-    ALCcontext *ctx;
-
-//    fprintf(stderr, "alcGetInteger for param: %d", param);
-    ALCint* pBuffers = (ALCint*) (*env)->GetDirectBufferAddress(env, buffer);
-
-    ctx = alcGetCurrentContext();
-    if(ctx != NULL) {
-        device = alcGetContextsDevice(ctx);
-
-        if (device != NULL) {
-            alcGetIntegerv(device, (ALCenum)param, (ALCsizei)bufferSize, pBuffers);
-        } else {
-            fprintf(stderr, "device is null in alcGetInteger");
-        }
-
-    } else {
-        fprintf(stderr, "current context is null in alcGetInteger");
-    }
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenAuxiliaryEffectSlots
-  (JNIEnv* env, jclass cl, jint numSlots, jobject buffer)
-{
-//    fprintf(stderr, "alGenAuxiliaryEffectSlots for numSlots: %d", numSlots);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
-//    alGenAuxiliaryEffectSlots((ALsizei)numSlots, pBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenEffects
-  (JNIEnv* env, jclass cl, jint numEffects, jobject buffer)
-{
-//    fprintf(stderr, "alGenEffects for numEffects: %d", numEffects);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
-//    alGenEffects((ALsizei)numEffects, pBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alEffecti
-  (JNIEnv *env, jclass cl, jint effect, jint param, jint value)
-{
-//    fprintf(stderr, "alEffecti for effect: %d, param: %d, value: %d", effect, param, value);
-//    alEffecti((ALuint)effect, (ALenum)param, (ALint)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alAuxiliaryEffectSloti
-  (JNIEnv *env, jclass cl, jint effectSlot, jint param, jint value)
-{
-//    fprintf(stderr, "alAuxiliaryEffectSloti for effect: %d, param: %d, value: %d", effectSlot, param, value);
-//    alAuxiliaryEffectSloti((ALuint)effectSlot, (ALenum)param, (ALint)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteEffects
-  (JNIEnv* env, jclass cl, jint numEffects, jobject buffer)
-{
-//    fprintf(stderr, "alDeleteEffects for numEffects: %d", numEffects);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
-//    alDeleteEffects((ALsizei)numEffects, pBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteAuxiliaryEffectSlots
-  (JNIEnv* env, jclass cl, jint numEffectSlots, jobject buffer)
-{
-//    fprintf(stderr, "alDeleteAuxiliaryEffectSlots for numEffectSlots: %d", numEffectSlots);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
-//    alDeleteAuxiliaryEffectSlots((ALsizei)numEffectSlots, pBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenFilters
-  (JNIEnv* env, jclass cl, jint numFilters, jobject buffer)
-{
-//    fprintf(stderr, "alGenFilters for numFilters: %d", numFilters);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
-//    alGenFilters((ALsizei)numFilters, pBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alFilteri
-  (JNIEnv *env, jclass cl, jint filter, jint param, jint value)
-{
-//    fprintf(stderr, "alFilteri for filter: %d, param: %d, value: %d", filter, param, value);
-//    alFilteri((ALuint)filter, (ALenum)param, (ALint)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alFilterf
-  (JNIEnv *env, jclass cl, jint filter, jint param, jfloat value)
-{
-//    fprintf(stderr, "alFilterf for filter: %d, param: %d, value: %f", filter, param, value);
-//    alFilterf((ALuint)filter, (ALenum)param, (ALfloat)value);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSource3i
-  (JNIEnv *env, jclass cl, jint source, jint param, jint value1, jint value2, jint value3)
-{
-//    fprintf(stderr, "alSource3i for source: %d, param: %d, value1: %d, value2: %d, value3: %d", source, param, value1, value2, value3);
-    alSource3i((ALuint)source, (ALenum)param, (ALint)value1, (ALint)value2, (ALint)value3);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteFilters
-  (JNIEnv* env, jclass cl, jint numFilters, jobject buffer)
-{
-//    fprintf(stderr, "alDeleteFilters for numFilters: %d", numFilters);
-    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
-//    alDeleteFilters((ALsizei)numFilters, pBuffers);
-}
-
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alEffectf
-  (JNIEnv *env, jclass cl, jint effect, jint param, jfloat value)
-{
-//    fprintf(stderr, "alEffectf for effect: %d, param: %d, value: %d", effect, param, value);
-//    alEffectf((ALuint)effect, (ALenum)param, (ALfloat)value);
-}
-

+ 0 - 319
jme3-ios/ios-data/templates/src/com_jme3_audio_android_AndroidOpenALSoftAudioRenderer.h

@@ -1,319 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class com_jme3_audio_android_AndroidOpenALSoftAudioRenderer */
-
-#ifndef _Included_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
-#define _Included_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Inaccessible static: logger */
-#undef com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_BUFFER_SIZE
-#define com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_BUFFER_SIZE 35280L
-#undef com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_STREAMING_BUFFER_COUNT
-#define com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_STREAMING_BUFFER_COUNT 5L
-#undef com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_MAX_NUM_CHANNELS
-#define com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_MAX_NUM_CHANNELS 64L
-#undef com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_UPDATE_RATE
-#define com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_UPDATE_RATE 0.05f
-/* Inaccessible static: _00024assertionsDisabled */
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alIsCreated
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alIsCreated
-  (JNIEnv *, jclass);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alCreate
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alCreate
-  (JNIEnv *, jclass);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alDestroy
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDestroy
-  (JNIEnv *, jclass);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alcGetString
- * Signature: (I)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alcGetString
-  (JNIEnv *, jclass, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGetString
- * Signature: (I)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGetString
-  (JNIEnv *, jclass, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGenSources
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenSources
-  (JNIEnv *, jclass);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGetError
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGetError
-  (JNIEnv *, jclass);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alDeleteSources
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteSources
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGenBuffers
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenBuffers
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alDeleteBuffers
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteBuffers
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourceStop
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourceStop
-  (JNIEnv *, jclass, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourcei
- * Signature: (III)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcei
-  (JNIEnv *, jclass, jint, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alBufferData
- * Signature: (IILjava/nio/ByteBuffer;II)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alBufferData
-  (JNIEnv *, jclass, jint, jint, jobject, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourcePlay
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcePlay
-  (JNIEnv *, jclass, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourcePause
- * Signature: (I)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcePause
-  (JNIEnv *, jclass, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourcef
- * Signature: (IIF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourcef
-  (JNIEnv *, jclass, jint, jint, jfloat);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSource3f
- * Signature: (IIFFF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSource3f
-  (JNIEnv *, jclass, jint, jint, jfloat, jfloat, jfloat);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGetSourcei
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGetSourcei
-  (JNIEnv *, jclass, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourceUnqueueBuffers
- * Signature: (IILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourceUnqueueBuffers
-  (JNIEnv *, jclass, jint, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSourceQueueBuffers
- * Signature: (IILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSourceQueueBuffers
-  (JNIEnv *, jclass, jint, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alListener
- * Signature: (ILjava/nio/FloatBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alListener
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alListenerf
- * Signature: (IF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alListenerf
-  (JNIEnv *, jclass, jint, jfloat);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alListener3f
- * Signature: (IFFF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alListener3f
-  (JNIEnv *, jclass, jint, jfloat, jfloat, jfloat);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alcIsExtensionPresent
- * Signature: (Ljava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alcIsExtensionPresent
-  (JNIEnv *, jclass, jstring);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alcGetInteger
- * Signature: (ILjava/nio/IntBuffer;I)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alcGetInteger
-  (JNIEnv *, jclass, jint, jobject, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGenAuxiliaryEffectSlots
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenAuxiliaryEffectSlots
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGenEffects
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenEffects
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alEffecti
- * Signature: (III)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alEffecti
-  (JNIEnv *, jclass, jint, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alAuxiliaryEffectSloti
- * Signature: (III)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alAuxiliaryEffectSloti
-  (JNIEnv *, jclass, jint, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alDeleteEffects
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteEffects
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alDeleteAuxiliaryEffectSlots
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteAuxiliaryEffectSlots
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alGenFilters
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alGenFilters
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alFilteri
- * Signature: (III)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alFilteri
-  (JNIEnv *, jclass, jint, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alFilterf
- * Signature: (IIF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alFilterf
-  (JNIEnv *, jclass, jint, jint, jfloat);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alSource3i
- * Signature: (IIIII)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alSource3i
-  (JNIEnv *, jclass, jint, jint, jint, jint, jint);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alDeleteFilters
- * Signature: (ILjava/nio/IntBuffer;)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alDeleteFilters
-  (JNIEnv *, jclass, jint, jobject);
-
-/*
- * Class:     com_jme3_audio_android_AndroidOpenALSoftAudioRenderer
- * Method:    alEffectf
- * Signature: (IIF)V
- */
-JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidOpenALSoftAudioRenderer_alEffectf
-  (JNIEnv *, jclass, jint, jint, jfloat);
-
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 138 - 0
jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosAL.c

@@ -0,0 +1,138 @@
+#include "com_jme3_audio_ios_IosAL.h"
+//#include "AL/al.h"
+//#include "AL/alext.h"
+
+#include "OpenAL/al.h"
+#include "OpenAL/alc.h"
+#include "OpenAL/oalMacOSX_OALExtensions.h"
+
+JNIEXPORT jstring JNICALL Java_com_jme3_audio_ios_IosAL_alGetString
+  (JNIEnv* env, jobject obj, jint param)
+{
+    return (*env)->NewStringUTF(env, alGetString(param));
+}
+
+JNIEXPORT jint JNICALL Java_com_jme3_audio_ios_IosAL_alGenSources
+  (JNIEnv *env, jobject obj)
+{
+    ALuint source;
+    alGenSources(1, &source);
+    return source;
+}
+
+JNIEXPORT jint JNICALL Java_com_jme3_audio_ios_IosAL_alGetError
+  (JNIEnv *env, jobject obj)
+{
+    return alGetError();
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alDeleteSources
+  (JNIEnv* env, jobject obj, jint numSources, jobject intbufSources)
+{
+    ALuint* pIntBufSources = (ALuint*) (*env)->GetDirectBufferAddress(env, intbufSources);
+    alDeleteSources((ALsizei)numSources, pIntBufSources);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alGenBuffers
+  (JNIEnv* env, jobject obj, jint numBuffers, jobject intbufBuffers)
+{
+    ALuint* pIntBufBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, intbufBuffers);
+    alGenBuffers((ALsizei)numBuffers, pIntBufBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alDeleteBuffers
+  (JNIEnv* env, jobject obj, jint numBuffers, jobject intbufBuffers)
+{
+    ALuint* pIntBufBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, intbufBuffers);
+    alDeleteBuffers((ALsizei)numBuffers, pIntBufBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourceStop
+  (JNIEnv *env, jobject obj, jint source)
+{
+    alSourceStop((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcei
+  (JNIEnv *env, jobject obj, jint source, jint param, jint value)
+{
+    alSourcei((ALuint)source, (ALenum)param, (ALint)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alBufferData
+  (JNIEnv* env, jobject obj, jint buffer, jint format, jobject bufferData, jint bufferSize, jint frequency)
+{
+    ALuint* pBufferData = (ALuint*) (*env)->GetDirectBufferAddress(env, bufferData);
+    alBufferData((ALuint)buffer, (ALenum)format, pBufferData, (ALsizei)bufferSize, (ALsizei)frequency);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcePlay
+  (JNIEnv *env, jobject obj, jint source)
+{
+    alSourcePlay((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcePause
+  (JNIEnv *env, jobject obj, jint source)
+{
+    alSourcePause((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcef
+  (JNIEnv *env, jobject obj, jint source, jint param, jfloat value)
+{
+    alSourcef((ALuint)source, (ALenum)param, (ALfloat)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSource3f
+  (JNIEnv *env, jobject obj, jint source, jint param, jfloat value1, jfloat value2, jfloat value3)
+{
+    alSource3f((ALuint)source, (ALenum)param, (ALfloat)value1, (ALfloat)value2, (ALfloat)value3);
+}
+
+JNIEXPORT jint JNICALL Java_com_jme3_audio_ios_IosAL_alGetSourcei
+  (JNIEnv *env, jobject obj, jint source, jint param)
+{
+    ALint result;
+    alGetSourcei((ALuint)source, (ALenum)param, &result);
+    return (jint)result;
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourceUnqueueBuffers
+  (JNIEnv* env, jobject obj, jint source, jint numBuffers, jobject buffers)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffers);
+    alSourceUnqueueBuffers((ALuint)source, (ALsizei)numBuffers, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourceQueueBuffers
+  (JNIEnv* env, jobject obj, jint source, jint numBuffers, jobject buffers)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffers);
+    alSourceQueueBuffers((ALuint)source, (ALsizei)numBuffers, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alListener
+  (JNIEnv* env, jobject obj, jint param, jobject bufferData)
+{
+    ALfloat* pBufferData = (ALfloat*) (*env)->GetDirectBufferAddress(env, bufferData);
+    alListenerfv((ALenum)param, pBufferData);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alListenerf
+  (JNIEnv *env, jobject obj, jint param, jfloat value)
+{
+    alListenerf((ALenum)param, (ALfloat)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alListener3f
+  (JNIEnv *env, jobject obj, jint param, jfloat value1, jfloat value2, jfloat value3)
+{
+    alListener3f((ALenum)param, (ALfloat)value1, (ALfloat)value2, (ALfloat)value3);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSource3i
+  (JNIEnv *env, jobject obj, jint source, jint param, jint value1, jint value2, jint value3)
+{
+    alSource3i((ALuint)source, (ALenum)param, (ALint)value1, (ALint)value2, (ALint)value3);
+}

+ 173 - 0
jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosAL.h

@@ -0,0 +1,173 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_audio_ios_IosAL */
+
+#ifndef _Included_com_jme3_audio_ios_IosAL
+#define _Included_com_jme3_audio_ios_IosAL
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alGetString
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_jme3_audio_ios_IosAL_alGetString
+  (JNIEnv *, jobject, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alGenSources
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_audio_ios_IosAL_alGenSources
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alGetError
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_audio_ios_IosAL_alGetError
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alDeleteSources
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alDeleteSources
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alGenBuffers
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alGenBuffers
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alDeleteBuffers
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alDeleteBuffers
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourceStop
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourceStop
+  (JNIEnv *, jobject, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourcei
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcei
+  (JNIEnv *, jobject, jint, jint, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alBufferData
+ * Signature: (IILjava/nio/ByteBuffer;II)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alBufferData
+  (JNIEnv *, jobject, jint, jint, jobject, jint, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourcePlay
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcePlay
+  (JNIEnv *, jobject, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourcePause
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcePause
+  (JNIEnv *, jobject, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourcef
+ * Signature: (IIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourcef
+  (JNIEnv *, jobject, jint, jint, jfloat);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSource3f
+ * Signature: (IIFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSource3f
+  (JNIEnv *, jobject, jint, jint, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alGetSourcei
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_com_jme3_audio_ios_IosAL_alGetSourcei
+  (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourceUnqueueBuffers
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourceUnqueueBuffers
+  (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSourceQueueBuffers
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSourceQueueBuffers
+  (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alListener
+ * Signature: (ILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alListener
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alListenerf
+ * Signature: (IF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alListenerf
+  (JNIEnv *, jobject, jint, jfloat);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alListener3f
+ * Signature: (IFFF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alListener3f
+  (JNIEnv *, jobject, jint, jfloat, jfloat, jfloat);
+
+/*
+ * Class:     com_jme3_audio_ios_IosAL
+ * Method:    alSource3i
+ * Signature: (IIIII)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosAL_alSource3i
+  (JNIEnv *, jobject, jint, jint, jint, jint, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 178 - 0
jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosALC.c

@@ -0,0 +1,178 @@
+//#include "util.h"
+#include "com_jme3_audio_ios_IosALC.h"
+//#include "AL/alc.h"
+//#include "AL/alext.h"
+
+#include "OpenAL/al.h"
+#include "OpenAL/alc.h"
+#include "OpenAL/oalMacOSX_OALExtensions.h"
+
+static jboolean created = JNI_FALSE;
+
+/* InitAL opens the default device and sets up a context using default
+ * attributes, making the program ready to call OpenAL functions. */
+static int InitAL()
+{
+    ALCdevice *device = NULL;
+    ALCcontext *ctx = NULL;
+
+    /* Open and initialize a device with default settings */
+    device = alcOpenDevice(NULL);
+    
+    if(device == NULL)
+    {
+        fprintf(stderr, "Could not open a device!\n");
+        goto cleanup;
+    }
+
+    ctx = alcCreateContext(device, NULL);
+    
+    if (ctx == NULL)
+    {
+        fprintf(stderr, "Could not create context!\n");
+        goto cleanup;
+    }
+    
+    if (!alcMakeContextCurrent(ctx)) 
+    {
+        fprintf(stderr, "Could not make context current!\n");
+        goto cleanup;
+    }
+
+    return 0;
+    
+cleanup:
+    if (ctx != NULL) alcDestroyContext(ctx);
+    if (device != NULL) alcCloseDevice(device);
+    return 1;
+}
+
+/* CloseAL closes the device belonging to the current context, and destroys the
+ * context. */
+static void CloseAL()
+{
+    ALCdevice *device;
+    ALCcontext *ctx;
+
+    ctx = alcGetCurrentContext();
+    
+    if (ctx == NULL) 
+    {
+        return;
+    }
+
+    device = alcGetContextsDevice(ctx);
+    
+    if (device == NULL) 
+    {
+        return;
+    }
+
+    if(!alcMakeContextCurrent(NULL)) {
+        return;
+    }
+
+    alcDestroyContext(ctx);
+    alcCloseDevice(device);
+}
+
+static ALCdevice* GetALCDevice()
+{
+    ALCdevice *device;
+    ALCcontext *ctx;
+
+    ctx = alcGetCurrentContext();
+    
+    if (ctx != NULL) 
+    {
+        device = alcGetContextsDevice(ctx);
+        
+        if (device != NULL)
+        {
+            return device;
+        }
+    }
+    
+    return NULL;
+}
+
+JNIEXPORT jboolean JNICALL Java_com_jme3_audio_ios_IosALC_isCreated
+  (JNIEnv* env, jobject obj)
+{
+    return created;
+}
+
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_createALC
+  (JNIEnv* env, jobject obj)
+{
+    created = (InitAL() == 0);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_destroyALC
+  (JNIEnv* env, jobject obj)
+{
+    CloseAL();
+    created = JNI_FALSE;
+}
+
+JNIEXPORT jstring JNICALL Java_com_jme3_audio_ios_IosALC_alcGetString
+  (JNIEnv* env, jobject obj, jint param)
+{
+    ALCdevice* device = GetALCDevice();
+    if (device == NULL) return NULL;
+    return (*env)->NewStringUTF(env, alcGetString(device, param));
+}
+
+JNIEXPORT jboolean JNICALL Java_com_jme3_audio_ios_IosALC_alcIsExtensionPresent
+  (JNIEnv* env, jobject obj, jstring extension)
+{
+    ALCdevice* device = GetALCDevice();
+    
+    if (device == NULL) return JNI_FALSE;
+    
+    const char* strExtension = (*env)->GetStringUTFChars(env, extension, NULL);
+    
+    if (strExtension == NULL)
+    {
+        return JNI_FALSE;
+    }
+    
+    jboolean result = alcIsExtensionPresent(device, strExtension);
+    
+    (*env)->ReleaseStringUTFChars(env, extension, strExtension);
+    
+    return result;
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_alcGetInteger
+  (JNIEnv* env, jobject obj, jint param, jobject buffer, jint bufferSize)
+{
+    ALCdevice* device = GetALCDevice();
+    
+    if (device == NULL) return;
+
+    ALCint* pBuffers = (ALCint*) (*env)->GetDirectBufferAddress(env, buffer);
+
+    alcGetIntegerv(device, (ALCenum)param, (ALCsizei)bufferSize, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_alcDevicePauseSOFT
+  (JNIEnv* env, jobject obj)
+{
+    ALCdevice* device = GetALCDevice();
+    
+    if (device == NULL) return;
+    
+//    alcDevicePauseSOFT(device);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_alcDeviceResumeSOFT
+  (JNIEnv* env, jobject obj)
+{
+    ALCdevice* device = GetALCDevice();
+    
+    if (device == NULL) return;
+    
+//    alcDeviceResumeSOFT(device);
+}

+ 77 - 0
jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosALC.h

@@ -0,0 +1,77 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_audio_ios_IosALC */
+
+#ifndef _Included_com_jme3_audio_ios_IosALC
+#define _Included_com_jme3_audio_ios_IosALC
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    createALC
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_createALC
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    destroyALC
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_destroyALC
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    isCreated
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_audio_ios_IosALC_isCreated
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    alcGetString
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_jme3_audio_ios_IosALC_alcGetString
+  (JNIEnv *, jobject, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    alcIsExtensionPresent
+ * Signature: (Ljava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_jme3_audio_ios_IosALC_alcIsExtensionPresent
+  (JNIEnv *, jobject, jstring);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    alcGetInteger
+ * Signature: (ILjava/nio/IntBuffer;I)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_alcGetInteger
+  (JNIEnv *, jobject, jint, jobject, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    alcDevicePauseSOFT
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_alcDevicePauseSOFT
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosALC
+ * Method:    alcDeviceResumeSOFT
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosALC_alcDeviceResumeSOFT
+  (JNIEnv *, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 79 - 0
jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosEFX.c

@@ -0,0 +1,79 @@
+//#include "util.h"
+#include "com_jme3_audio_ios_IosEFX.h"
+//#include "AL/alext.h"
+
+#include "OpenAL/al.h"
+#include "OpenAL/alc.h"
+#include "OpenAL/oalMacOSX_OALExtensions.h"
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alGenAuxiliaryEffectSlots
+  (JNIEnv* env, jobject obj, jint numSlots, jobject buffer)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
+//    alGenAuxiliaryEffectSlots((ALsizei)numSlots, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alGenEffects
+  (JNIEnv* env, jobject obj, jint numEffects, jobject buffer)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
+//    alGenEffects((ALsizei)numEffects, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alEffecti
+  (JNIEnv* env, jobject obj, jint effect, jint param, jint value)
+{
+//    alEffecti((ALuint)effect, (ALenum)param, (ALint)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alAuxiliaryEffectSloti
+  (JNIEnv* env, jobject obj, jint effectSlot, jint param, jint value)
+{
+//    alAuxiliaryEffectSloti((ALuint)effectSlot, (ALenum)param, (ALint)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alDeleteEffects
+  (JNIEnv* env, jobject obj, jint numEffects, jobject buffer)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
+//    alDeleteEffects((ALsizei)numEffects, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alDeleteAuxiliaryEffectSlots
+  (JNIEnv* env, jobject obj, jint numEffectSlots, jobject buffer)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
+//    alDeleteAuxiliaryEffectSlots((ALsizei)numEffectSlots, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alGenFilters
+  (JNIEnv* env, jobject obj, jint numFilters, jobject buffer)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
+//    alGenFilters((ALsizei)numFilters, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alFilteri
+  (JNIEnv* env, jobject obj, jint filter, jint param, jint value)
+{
+//    alFilteri((ALuint)filter, (ALenum)param, (ALint)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alFilterf
+  (JNIEnv* env, jobject obj, jint filter, jint param, jfloat value)
+{
+//    alFilterf((ALuint)filter, (ALenum)param, (ALfloat)value);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alDeleteFilters
+  (JNIEnv* env, jobject obj, jint numFilters, jobject buffer)
+{
+    ALuint* pBuffers = (ALuint*) (*env)->GetDirectBufferAddress(env, buffer);
+//    alDeleteFilters((ALsizei)numFilters, pBuffers);
+}
+
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alEffectf
+  (JNIEnv* env, jobject obj, jint effect, jint param, jfloat value)
+{
+//    alEffectf((ALuint)effect, (ALenum)param, (ALfloat)value);
+}

+ 101 - 0
jme3-ios/ios-data/templates/src/com_jme3_audio_ios_IosEFX.h

@@ -0,0 +1,101 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_jme3_audio_ios_IosEFX */
+
+#ifndef _Included_com_jme3_audio_ios_IosEFX
+#define _Included_com_jme3_audio_ios_IosEFX
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alGenAuxiliaryEffectSlots
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alGenAuxiliaryEffectSlots
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alGenEffects
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alGenEffects
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alEffecti
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alEffecti
+  (JNIEnv *, jobject, jint, jint, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alAuxiliaryEffectSloti
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alAuxiliaryEffectSloti
+  (JNIEnv *, jobject, jint, jint, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alDeleteEffects
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alDeleteEffects
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alDeleteAuxiliaryEffectSlots
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alDeleteAuxiliaryEffectSlots
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alGenFilters
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alGenFilters
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alFilteri
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alFilteri
+  (JNIEnv *, jobject, jint, jint, jint);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alFilterf
+ * Signature: (IIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alFilterf
+  (JNIEnv *, jobject, jint, jint, jfloat);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alDeleteFilters
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alDeleteFilters
+  (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class:     com_jme3_audio_ios_IosEFX
+ * Method:    alEffectf
+ * Signature: (IIF)V
+ */
+JNIEXPORT void JNICALL Java_com_jme3_audio_ios_IosEFX_alEffectf
+  (JNIEnv *, jobject, jint, jint, jfloat);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 1 - 1
jme3-ios/nbproject/project.properties

@@ -1,4 +1,4 @@
-javac.source=1.6
+javac.source=1.8
 javac.compilerargs=-Xlint -Xlint:-serial
 # avian compile locations (Now in downloads/)
 #avian.jdk.path=/Users/normenhansen/Documents/Code-Import/avian-ios/openjdk-1.7.0-u40-unofficial-macosx-x86_64-image

+ 3 - 0
jme3-ios/src/com/jme3/gde/ios/panel/IosCustomizerPanel.form

@@ -84,6 +84,9 @@
           </StringArray>
         </Property>
       </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+      </AuxValues>
     </Component>
     <Component class="javax.swing.JLabel" name="jLabel1">
       <Properties>

+ 7 - 6
jme3-ios/src/com/jme3/gde/ios/panel/IosCustomizerPanel.java

@@ -50,7 +50,7 @@ import org.openide.util.HelpCtx;
  */
 public class IosCustomizerPanel extends javax.swing.JPanel implements ActionListener {
 
-    private ProjectExtensionProperties properties;
+    private final ProjectExtensionProperties properties;
 
     /**
      * Creates new form LwjglAppletCustomizerPanel
@@ -79,14 +79,14 @@ public class IosCustomizerPanel extends javax.swing.JPanel implements ActionList
     private void saveProperties() {
         //TODO: check properties
         properties.setProperty("ios.enabled", "" + jCheckBox1.isSelected());
-        String version = (String) jComboBox1.getSelectedItem();
+        String version = jComboBox1.getItemAt(jComboBox1.getSelectedIndex());
         properties.setProperty("ios.version", version);
         properties.setProperty("delete.folder", "" + jCheckBox2.isSelected());
     }
 
     private void setSelected(String name) {
         for (int i = 0; i < jComboBox1.getItemCount(); i++) {
-            String target = (String) jComboBox1.getItemAt(i);
+            String target = jComboBox1.getItemAt(i);
             if (target.equals(name)) {
                 jComboBox1.setSelectedIndex(i);
                 return;
@@ -94,6 +94,7 @@ public class IosCustomizerPanel extends javax.swing.JPanel implements ActionList
         }
     }
 
+    @Override
     public void actionPerformed(ActionEvent e) {
         saveProperties();
     }
@@ -108,7 +109,7 @@ public class IosCustomizerPanel extends javax.swing.JPanel implements ActionList
     private void initComponents() {
 
         jCheckBox1 = new javax.swing.JCheckBox();
-        jComboBox1 = new javax.swing.JComboBox();
+        jComboBox1 = new javax.swing.JComboBox<>();
         jLabel1 = new javax.swing.JLabel();
         jCheckBox2 = new javax.swing.JCheckBox();
         jTextField1 = new javax.swing.JTextField();
@@ -118,7 +119,7 @@ public class IosCustomizerPanel extends javax.swing.JPanel implements ActionList
 
         jCheckBox1.setText(org.openide.util.NbBundle.getMessage(IosCustomizerPanel.class, "IosCustomizerPanel.jCheckBox1.text")); // NOI18N
 
-        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
+        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
 
         jLabel1.setText(org.openide.util.NbBundle.getMessage(IosCustomizerPanel.class, "IosCustomizerPanel.jLabel1.text")); // NOI18N
 
@@ -183,7 +184,7 @@ public class IosCustomizerPanel extends javax.swing.JPanel implements ActionList
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JCheckBox jCheckBox1;
     private javax.swing.JCheckBox jCheckBox2;
-    private javax.swing.JComboBox jComboBox1;
+    private javax.swing.JComboBox<String> jComboBox1;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JScrollPane jScrollPane1;

+ 2 - 2
jme3-lwjgl-applet/nbproject/genfiles.properties

@@ -3,6 +3,6 @@ build.xml.script.CRC32=1ed5abd5
 [email protected]
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=64d361e4
+nbproject/build-impl.xml.data.CRC32=e0b40cca
 nbproject/build-impl.xml.script.CRC32=a70d83dd
-nbproject/build-impl.xml.stylesheet.CRC32=[email protected]
+nbproject/build-impl.xml.stylesheet.CRC32=[email protected]

+ 4 - 6
jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.form

@@ -59,17 +59,15 @@
     <Component class="javax.swing.JComboBox" name="techniqueComboBox">
       <Properties>
         <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
-          <StringArray count="4">
-            <StringItem index="0" value="Item 1"/>
-            <StringItem index="1" value="Item 2"/>
-            <StringItem index="2" value="Item 3"/>
-            <StringItem index="3" value="Item 4"/>
-          </StringArray>
+          <StringArray count="0"/>
         </Property>
       </Properties>
       <Events>
         <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="techniqueComboBoxActionPerformed"/>
       </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;TechniqueBlock&gt;"/>
+      </AuxValues>
     </Component>
     <Component class="javax.swing.JButton" name="jButton1">
       <Properties>

+ 6 - 5
jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorToolBar.java

@@ -51,7 +51,7 @@ import javax.swing.ListCellRenderer;
 public class MatDefEditorToolBar extends JPanel {
 
     private MatDefEditorlElement parent;
-    private final DefaultComboBoxModel<TechniqueBlock> comboModel = new DefaultComboBoxModel<TechniqueBlock>();
+    private final DefaultComboBoxModel<TechniqueBlock> comboModel = new DefaultComboBoxModel<>();
     private final static Logger logger = Logger.getLogger(MatDefEditorToolBar.class.getName());
     
     /**
@@ -62,12 +62,14 @@ public class MatDefEditorToolBar extends JPanel {
         techniqueComboBox.setModel(comboModel);
         final DefaultListCellRenderer renderer = new DefaultListCellRenderer();
         techniqueComboBox.setRenderer(new ListCellRenderer<TechniqueBlock>() {
+            
             @Override
-            public Component getListCellRendererComponent(JList list, TechniqueBlock value, int index, boolean isSelected, boolean cellHasFocus) {
+            public Component getListCellRendererComponent(JList<? extends TechniqueBlock> list, TechniqueBlock value, int index, boolean isSelected, boolean cellHasFocus) {
                 JLabel c = (JLabel) renderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                 c.setText(value.getName());
                 return c;
             }
+            
         });
 
     }
@@ -95,7 +97,7 @@ public class MatDefEditorToolBar extends JPanel {
     private void initComponents() {
 
         jLabel1 = new javax.swing.JLabel();
-        techniqueComboBox = new javax.swing.JComboBox();
+        techniqueComboBox = new javax.swing.JComboBox<>();
         jButton1 = new javax.swing.JButton();
         jSeparator1 = new javax.swing.JSeparator();
         jButton2 = new javax.swing.JButton();
@@ -105,7 +107,6 @@ public class MatDefEditorToolBar extends JPanel {
         jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(MatDefEditorToolBar.class, "MatDefEditorToolBar.jLabel1.text")); // NOI18N
 
-        techniqueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
         techniqueComboBox.addActionListener(new java.awt.event.ActionListener() {
             public void actionPerformed(java.awt.event.ActionEvent evt) {
                 techniqueComboBoxActionPerformed(evt);
@@ -196,6 +197,6 @@ public class MatDefEditorToolBar extends JPanel {
     private javax.swing.JButton jButton2;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JSeparator jSeparator1;
-    private javax.swing.JComboBox techniqueComboBox;
+    private javax.swing.JComboBox<TechniqueBlock> techniqueComboBox;
     // End of variables declaration//GEN-END:variables
 }

+ 1 - 1
jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java

@@ -81,7 +81,7 @@ public class ShaderEditPanel extends JPanel {
 
             @Override
             public void keyPressed(KeyEvent e) {
-                if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) {
+                if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0)) {
                     saveCurrent();
                 }
             }

+ 37 - 40
jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java

@@ -52,12 +52,12 @@ public class EditableMaterialFile {
     private static final Logger logger = Logger.getLogger(EditableMaterialFile.class.getName());
     private String name;
     private String matDefName;
-    private FileObject material;
+    private final FileObject material;
     private FileObject matDef;
-    private Map<String, MaterialProperty> materialParameters = new LinkedHashMap<String, MaterialProperty>();
-    private Map<String, MaterialProperty> additionalRenderStates = new HashMap<String, MaterialProperty>();
-    private List<String> matDefEntries = new ArrayList<String>();
-    private ProjectAssetManager manager;
+    private final Map<String, MaterialProperty> materialParameters = new LinkedHashMap<>();
+    private final Map<String, MaterialProperty> additionalRenderStates = new HashMap<>();
+    private final List<String> matDefEntries = new ArrayList<>();
+    private final ProjectAssetManager manager;
     private FileSystem fs;
     public static final String[] variableTypes = new String[]{"Int", "Boolean", "Float", "Vector2", "Vector3", "Vector4", "Color", "Texture2D", "Texture3D", "TextureArray", "TextureBuffer", "TextureCubeMap"};
 
@@ -106,11 +106,11 @@ public class EditableMaterialFile {
                     states = true;
                 }
                 //up a level
-                if (line.indexOf("{") != -1) {
+                if (line.contains("{")) {
                     level++;
                 }
                 //down a level, stop processing parameters/states
-                if (line.indexOf("}") != -1) {
+                if (line.contains("}")) {
                     level--;
                     if (params) {
                         params = false;
@@ -194,17 +194,17 @@ public class EditableMaterialFile {
             try {
                 fs = FileUtil.createMemoryFileSystem();
                 matDef = fs.getRoot().createData(name, "j3md");
-                OutputStream out = matDef.getOutputStream();
-                InputStream in = manager.getResourceAsStream(getMatDefName());
-                if (in != null) {
-                    int input = in.read();
-                    while (input != -1) {
-                        out.write(input);
-                        input = in.read();
+                try (OutputStream out = matDef.getOutputStream()) {
+                    InputStream in = manager.getResourceAsStream(getMatDefName());
+                    if (in != null) {
+                        int input = in.read();
+                        while (input != -1) {
+                            out.write(input);
+                            input = in.read();
+                        }
+                        in.close();
                     }
-                    in.close();
                 }
-                out.close();
             } catch (IOException ex) {
                 Exceptions.printStackTrace(ex);
             }
@@ -229,10 +229,10 @@ public class EditableMaterialFile {
                     if (defLine.startsWith("MaterialParameters ") || defLine.startsWith("MaterialParameters\t") || defLine.startsWith("MaterialParameters{") && level == 1) {
                         params = true;
                     }
-                    if (defLine.indexOf("{") != -1) {
+                    if (defLine.contains("{")) {
                         level++;
                     }
-                    if (defLine.indexOf("}") != -1) {
+                    if (defLine.contains("}")) {
                         level--;
                         if (params) {
                             params = false;
@@ -285,8 +285,8 @@ public class EditableMaterialFile {
         try {
             List<String> matLines = material.asLines();
             StringWriter out = new StringWriter();
-            List<String> setValues = new LinkedList<String>();
-            List<String> setStates = new LinkedList<String>();
+            List<String> setValues = new LinkedList<>();
+            List<String> setStates = new LinkedList<>();
             //goes through the lines of the material file and replaces the values it finds
             for (String line : matLines) {
                 String newLine = line;
@@ -294,7 +294,7 @@ public class EditableMaterialFile {
                 //write material header
                 if (line.startsWith("Material ") || line.startsWith("Material\t") && level == 0) {
                     String suffix = "";
-                    if (line.indexOf("{") > -1) {
+                    if (line.contains("{")) {
                         suffix = "{";
                     }
                     newLine = "Material " + getName() + " : " + matDefName + " " + suffix;
@@ -309,16 +309,15 @@ public class EditableMaterialFile {
                     addedstates = true;
                 }
                 //up a level
-                if (line.indexOf("{") != -1) {
+                if (line.contains("{")) {
                     level++;
                 }
                 //down a level, stop processing states and check if all parameters and states have been written
-                if (line.indexOf("}") != -1) {
+                if (line.contains("}")) {
                     level--;
                     //find and write parameters we did not replace yet at end of parameters section
                     if (params) {
-                        for (Iterator<Map.Entry<String, MaterialProperty>> it = materialParameters.entrySet().iterator(); it.hasNext();) {
-                            Map.Entry<String, MaterialProperty> entry = it.next();
+                        for (Map.Entry<String, MaterialProperty> entry : materialParameters.entrySet()) {
                             if (!setValues.contains(entry.getKey()) && matDefEntries.contains(entry.getKey())) {
                                 MaterialProperty prop = entry.getValue();
                                 if (prop.getValue() != null && prop.getValue().length() > 0) {
@@ -331,8 +330,7 @@ public class EditableMaterialFile {
                     }
                     //find and write states we did not replace yet at end of states section
                     if (states) {
-                        for (Iterator<Map.Entry<String, MaterialProperty>> it = additionalRenderStates.entrySet().iterator(); it.hasNext();) {
-                            Map.Entry<String, MaterialProperty> entry = it.next();
+                        for (Map.Entry<String, MaterialProperty> entry : additionalRenderStates.entrySet()) {
                             if (!setStates.contains(entry.getKey())) {
                                 MaterialProperty prop = entry.getValue();
                                 if (prop.getValue() != null && prop.getValue().length() > 0) {
@@ -348,8 +346,7 @@ public class EditableMaterialFile {
                         if (!addedstates) {
                             String myLine = "    AdditionalRenderState {\n";
                             out.write(myLine, 0, myLine.length());
-                            for (Iterator<Map.Entry<String, MaterialProperty>> it = additionalRenderStates.entrySet().iterator(); it.hasNext();) {
-                                Map.Entry<String, MaterialProperty> entry = it.next();
+                            for (Map.Entry<String, MaterialProperty> entry : additionalRenderStates.entrySet()) {
                                 if (!setStates.contains(entry.getKey())) {
                                     MaterialProperty prop = entry.getValue();
                                     if (prop.getValue() != null && prop.getValue().length() > 0) {
@@ -420,12 +417,12 @@ public class EditableMaterialFile {
     }
 
     private void createBaseMaterialFile() throws IOException {
-        OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream());
-        out.write("Material MyMaterial : " + matDefName + " {\n");
-        out.write("    MaterialParameters {\n");
-        out.write("    }\n");
-        out.write("}\n");
-        out.close();
+        try (OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream())) {
+            out.write("Material MyMaterial : " + matDefName + " {\n");
+            out.write("    MaterialParameters {\n");
+            out.write("    }\n");
+            out.write("}\n");
+        }
     }
 
  
@@ -453,15 +450,16 @@ public class EditableMaterialFile {
     }
 
     public void setAsText(String text) throws IOException {
-        OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream());
-        out.write(text, 0, text.length());
-        out.close();
+        try (OutputStreamWriter out = new OutputStreamWriter(material.getOutputStream())) {
+            out.write(text, 0, text.length());
+        }
     }
 
     /**
      * Creates the data from a material
      *
      * @param mat
+     * @throws java.io.IOException
      */
     public void setAsMaterial(Material mat) throws IOException {
         assert (mat.getMaterialDef().getAssetName() != null);
@@ -491,8 +489,7 @@ public class EditableMaterialFile {
      */
     private void checkPackedTextureProps(Material mat) {
         Collection<MatParam> params = mat.getParams();
-        for (Iterator<MatParam> it = new ArrayList<MatParam>(params).iterator(); it.hasNext();) {
-            MatParam param = it.next();
+        for (MatParam param : new ArrayList<>(params)) {
             MaterialProperty prop = new MaterialProperty(param);
             if (prop.getValue() == null) {
                 switch (param.getVarType()) {

+ 1 - 0
jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorPanel.java

@@ -308,6 +308,7 @@ private void aLabelFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_a
     protected void readProperty() {
         java.awt.EventQueue.invokeLater(new Runnable() {
             
+            @Override
             public void run() {
                 jLabel1.setText(property.getName());
                 jLabel1.setToolTipText(property.getName());                

+ 2 - 2
jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/ColorRGBADialog.java

@@ -60,7 +60,7 @@ public class ColorRGBADialog extends javax.swing.JDialog {
         float[] floats = new float[4];
         jColorChooser1.getColor().getComponents(floats);
         color = new Color(floats[0], floats[1], floats[2], ((float) alphaSlider.getValue()) / 100.0f);
-        String str = new String(floats[0] + " " + floats[1] + " " + floats[2] + " " + ((float) alphaSlider.getValue()) / 100.0f);
+        String str = floats[0] + " " + floats[1] + " " + floats[2] + " " + ((float) alphaSlider.getValue()) / 100.0f;
         strColor = str;
     }
 
@@ -169,7 +169,7 @@ public class ColorRGBADialog extends javax.swing.JDialog {
             this.color = color;
             jColorChooser1.setColor(color);
 
-            alphaSlider.setValue((int) ((float) (color.getAlpha() / 255f) * 100));
+            alphaSlider.setValue((int) ((color.getAlpha() / 255f) * 100));
         }
 
     }

+ 5 - 1
jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.form

@@ -1,4 +1,4 @@
-<?xml version="1.1" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 
 <Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
   <NonVisualComponents>
@@ -47,6 +47,7 @@
   <SyntheticProperties>
     <SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
     <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+    <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
   </SyntheticProperties>
   <Events>
     <EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
@@ -292,6 +293,9 @@
           <Events>
             <EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="lstFileListKeyTyped"/>
           </Events>
+          <AuxValues>
+            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;File&gt;"/>
+          </AuxValues>
         </Component>
       </SubComponents>
     </Container>

+ 37 - 33
jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java

@@ -92,7 +92,7 @@ public class NVCompress extends javax.swing.JFrame {
         lblCompressType = new javax.swing.JLabel();
         chkCuda = new javax.swing.JCheckBox();
         sclFileList = new javax.swing.JScrollPane();
-        lstFileList = new javax.swing.JList();
+        lstFileList = new javax.swing.JList<>();
         btnAddFiles = new javax.swing.JButton();
         btnRemoveFiles = new javax.swing.JButton();
         pnlExportOpt = new javax.swing.JPanel();
@@ -356,7 +356,7 @@ public class NVCompress extends javax.swing.JFrame {
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(barProgress, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
-                    .addComponent(btnRemoveFiles, javax.swing.GroupLayout.PREFERRED_SIZE, 24, Short.MAX_VALUE)
+                    .addComponent(btnRemoveFiles, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                     .addComponent(btnAddFiles, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                 .addContainerGap())
         );
@@ -365,7 +365,7 @@ public class NVCompress extends javax.swing.JFrame {
     }// </editor-fold>//GEN-END:initComponents
 
     private String[] computeCompressParameters(){
-        List<String> params = new ArrayList<String>();
+        List<String> params = new ArrayList<>();
 
         if (!chkCuda.isSelected())
             params.add("-nocuda");
@@ -453,16 +453,17 @@ public class NVCompress extends javax.swing.JFrame {
         if (manager == null)
             manager = JmeSystem.newAssetManager();
 
-        manager.registerLocator(input.getParent().toString(),
+        manager.registerLocator(input.getParent(),
                                 FileLocator.class);
 
         String format = (String) cmbCompressType.getSelectedItem();
         if (format.equals("PNG-RGBE")){
             HDRLoader loader = new HDRLoader(true);
             try{
-                FileInputStream in = new FileInputStream(input);
-                Image image = loader.load(in, false);
-                in.close();
+                Image image;
+                try (FileInputStream in = new FileInputStream(input)) {
+                    image = loader.load(in, false);
+                }
 
                 BufferedImage rgbeImage = ImageToAwt.convert(image, false, true, 0);
                 if (output == null){
@@ -500,22 +501,22 @@ public class NVCompress extends javax.swing.JFrame {
             ProcessBuilder builder = new ProcessBuilder(args);
             updateWork(statusStr, 0);
             p = builder.start();
-            BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
-            String ln;
-            while ((ln = r.readLine()) != null){
-                if (Thread.interrupted())
-                    throw new InterruptedException();
-                
-                if (ln.endsWith("%")){
-                    // show status in bar
-                    int percent = Integer.parseInt(ln.substring(0, ln.length()-1));
-                    updateWork(statusStr, percent);
-                }else if (ln.startsWith("time taken")){
-                    ln = ln.substring(12, ln.length()-7).trim();
-                    System.out.println("Time Taken: "+ln+" seconds");
+            try (BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()))) {
+                String ln;
+                while ((ln = r.readLine()) != null){
+                    if (Thread.interrupted())
+                        throw new InterruptedException();
+                    
+                    if (ln.endsWith("%")){
+                        // show status in bar
+                        int percent = Integer.parseInt(ln.substring(0, ln.length()-1));
+                        updateWork(statusStr, percent);
+                    }else if (ln.startsWith("time taken")){
+                        ln = ln.substring(12, ln.length()-7).trim();
+                        System.out.println("Time Taken: "+ln+" seconds");
+                    }
                 }
             }
-            r.close();
             int error = p.waitFor();
             if (error != 0){
                 System.out.println("Error Code: " + error);
@@ -573,20 +574,20 @@ public class NVCompress extends javax.swing.JFrame {
     }
 
     private Object[] compileFileList(){
-        Object[] values = lstFileList.getSelectedValues();
-        if (values == null || values.length == 0){
+        List<File> values = lstFileList.getSelectedValuesList();
+        if (values == null || values.isEmpty()){
             // no specific files selected, add all of them
-            DefaultListModel listModel = (DefaultListModel) lstFileList.getModel();
-            values = listModel.toArray();
+            DefaultListModel<File> listModel = (DefaultListModel) lstFileList.getModel();
+            return listModel.toArray();
         }
-        return values;
+        return values.toArray();
     }
 
     private void runNVCompressAll(final File exportDir){
         final Object[] fileList = compileFileList();
         if (fileList != null && fileList.length > 0){
             startWork();
-            workThread = new Thread(){
+            workThread = new Thread("NVCompressor"){
                 @Override
                 public void run(){
                     for (Object val : fileList){
@@ -618,7 +619,7 @@ public class NVCompress extends javax.swing.JFrame {
         final Object[] fileList = compileFileList();
         if (fileList != null && fileList.length > 0){
             startWork();
-            workThread = new Thread(){
+            workThread = new Thread("J3Compressor"){
                 @Override
                 public void run(){
                     for (Object val : fileList){
@@ -650,7 +651,7 @@ public class NVCompress extends javax.swing.JFrame {
         final Object[] fileList = compileFileList();
         if (fileList != null && fileList.length > 0){
             startWork();
-            workThread = new Thread(){
+            workThread = new Thread("NVDecompressor"){
                 @Override
                 public void run(){
                     for (Object val : fileList){
@@ -748,9 +749,9 @@ public class NVCompress extends javax.swing.JFrame {
     }//GEN-LAST:event_btnAddFilesActionPerformed
 
     private void btnRemoveFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveFilesActionPerformed
-        Object[] selected = lstFileList.getSelectedValues();
-        DefaultListModel listModel = (DefaultListModel) lstFileList.getModel();
-        for (Object val : selected){
+        List<File> selected = lstFileList.getSelectedValuesList();
+        DefaultListModel<File> listModel = (DefaultListModel) lstFileList.getModel();
+        for (File val : selected){
             listModel.removeElement(val);
         }
     }//GEN-LAST:event_btnRemoveFilesActionPerformed
@@ -866,9 +867,12 @@ public class NVCompress extends javax.swing.JFrame {
         }
 
         java.awt.EventQueue.invokeLater(new Runnable() {
+            
+            @Override
             public void run() {
                 new NVCompress().setVisible(true);
             }
+            
         });
     }
 
@@ -891,7 +895,7 @@ public class NVCompress extends javax.swing.JFrame {
     private javax.swing.JLabel lblCompressType;
     private javax.swing.JLabel lblMapType;
     private javax.swing.JLabel lblTargetDir;
-    private javax.swing.JList lstFileList;
+    private javax.swing.JList<File> lstFileList;
     private javax.swing.JMenuItem menuAbout;
     private javax.swing.JMenu menuFile;
     private javax.swing.JMenu menuHelp;

+ 3 - 3
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.form

@@ -77,7 +77,7 @@
           <Layout>
             <DimensionLayout dim="0">
               <Group type="103" groupAlignment="0" attributes="0">
-                  <EmptySpace min="0" pref="412" max="32767" attributes="0"/>
+                  <EmptySpace min="0" pref="372" max="32767" attributes="0"/>
               </Group>
             </DimensionLayout>
             <DimensionLayout dim="1">
@@ -90,7 +90,7 @@
         <Component class="javax.swing.JButton" name="addButton">
           <Properties>
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
-              <Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/add.png"/>
+              <Image iconType="3" name="/com/jme3/gde/core/editor/icons/add.png"/>
             </Property>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
               <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel2.addButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
@@ -107,7 +107,7 @@
         <Component class="javax.swing.JButton" name="delButton">
           <Properties>
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
-              <Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/remove.png"/>
+              <Image iconType="3" name="/com/jme3/gde/core/editor/icons/remove.png"/>
             </Property>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
               <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel2.delButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>

+ 3 - 3
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java

@@ -135,7 +135,7 @@ public final class SNDefVisualPanel2 extends JPanel {
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 412, Short.MAX_VALUE)
+            .addGap(0, 372, Short.MAX_VALUE)
         );
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -144,7 +144,7 @@ public final class SNDefVisualPanel2 extends JPanel {
 
         jToolBar1.add(jPanel1);
 
-        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/add.png"))); // NOI18N
+        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/core/editor/icons/add.png"))); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.text")); // NOI18N
         addButton.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.toolTipText")); // NOI18N
         addButton.setAlignmentX(0.5F);
@@ -155,7 +155,7 @@ public final class SNDefVisualPanel2 extends JPanel {
         });
         jToolBar1.add(addButton);
 
-        delButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/remove.png"))); // NOI18N
+        delButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/core/editor/icons/remove.png"))); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(delButton, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.text")); // NOI18N
         delButton.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.toolTipText")); // NOI18N
         delButton.setAlignmentX(0.5F);

+ 11 - 12
jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java

@@ -22,16 +22,15 @@ import com.jme3.shader.VarType;
 import com.jme3.texture.Texture;
 import java.awt.Component;
 import java.awt.Dialog;
-import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.logging.Logger;
 import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.JComponent;
 import org.netbeans.api.progress.ProgressHandle;
 import org.netbeans.api.project.Project;
@@ -73,6 +72,7 @@ public final class ImportModel implements ActionListener {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         Project context = OpenProjects.getDefault().getMainProject();
         if (context == null) {
@@ -95,6 +95,8 @@ public final class ImportModel implements ActionListener {
         boolean cancelled = wiz.getValue() != WizardDescriptor.FINISH_OPTION;
         if (!cancelled) {
             new Thread(new Runnable() {
+                
+                @Override
                 public void run() {
                     ProgressHandle handle = ProgressHandle.createHandle("Importing Model..");
                     handle.start();
@@ -105,7 +107,7 @@ public final class ImportModel implements ActionListener {
                     }
                     handle.finish();
                 }
-            }).start();
+            }, "ModelImporter").start();
         }
     }
 
@@ -123,11 +125,10 @@ public final class ImportModel implements ActionListener {
             throw new IllegalStateException("Cannot find project AssetManager!");
         }
 
-        List<FileObject> deleteList = new LinkedList<FileObject>();
+        List<FileObject> deleteList = new LinkedList<>();
         int idx = 0;
         //go through list and copy assets to project
-        for (Iterator<FileObject> it = assetList.iterator(); it.hasNext();) {
-            FileObject source = it.next();
+        for (FileObject source : assetList) {
             AssetKey key = assetKeys.get(idx);
             UberAssetInfo info = UberAssetLocator.getInfo(key);
             if (info != null) {
@@ -228,8 +229,7 @@ public final class ImportModel implements ActionListener {
         }
         //delete files if not keeping original
         if (!keepFiles) {
-            for (Iterator<FileObject> it = deleteList.iterator(); it.hasNext();) {
-                FileObject fileObject = it.next();
+            for (FileObject fileObject : deleteList) {
                 try {
                     fileObject.delete();
                 } catch (IOException ex) {
@@ -250,8 +250,7 @@ public final class ImportModel implements ActionListener {
                 Material mat = geom.getMaterial();
                 if (mat != null) {
                     Collection<MatParam> params = mat.getParams();
-                    for (Iterator<MatParam> it = params.iterator(); it.hasNext();) {
-                        MatParam matParam = it.next();
+                    for (MatParam matParam : params) {
                         VarType paramType = matParam.getVarType();
                         String paramName = matParam.getName();
                         switch (paramType) {
@@ -316,7 +315,7 @@ public final class ImportModel implements ActionListener {
                     JComponent jc = (JComponent) c;
                     // Sets step number of a component
                     // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
-                    jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+                    jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
                     // Sets steps names for a panel
                     jc.putClientProperty("WizardPanel_contentData", steps);
                     // Turn on subtitle creation on each step

+ 5 - 2
jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshAction.java

@@ -26,6 +26,7 @@ public class NavMeshAction implements ActionListener {
         this.context = context;
     }
 
+    @Override
     public void actionPerformed(ActionEvent ev) {
         final ProjectAssetManager manager = context.getLookup().lookup(ProjectAssetManager.class);
         if (manager == null) {
@@ -33,6 +34,7 @@ public class NavMeshAction implements ActionListener {
         }
         Runnable call = new Runnable() {
 
+            @Override
             public void run() {
                 ProgressHandle progressHandle = ProgressHandle.createHandle("Opening in Nav Mesh Editor");
                 progressHandle.start();
@@ -43,8 +45,9 @@ public class NavMeshAction implements ActionListener {
                 if(asset!=null){
                     java.awt.EventQueue.invokeLater(new Runnable() {
 
+                        @Override
                         public void run() {
-                            manager.getManager().clearCache();
+                            manager.clearCache();
                             NavMeshTopComponent composer = NavMeshTopComponent.findInstance();
                             composer.openScene(asset, context, manager);
                         }
@@ -59,7 +62,7 @@ public class NavMeshAction implements ActionListener {
                 progressHandle.finish();
             }
         };
-        new Thread(call).start();
+        new Thread(call, "NavMeshLoader").start();
     }
     
 }

+ 5 - 4
jme3-navmesh-gen/src/com/jme3/gde/nmgen/NavMeshGenerator.java

@@ -8,7 +8,6 @@ import com.jme3.export.Savable;
 import com.jme3.math.FastMath;
 import com.jme3.math.Vector3f;
 import com.jme3.scene.Mesh;
-import com.jme3.scene.Node;
 import com.jme3.scene.VertexBuffer.Type;
 import com.jme3.scene.mesh.IndexBuffer;
 import com.jme3.terrain.Terrain;
@@ -468,6 +467,7 @@ public class NavMeshGenerator implements Savable {
         this.timeout = timeout;
     }
     
+    @Override
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule oc = ex.getCapsule(this);
         oc.write(cellSize, "cellSize", 1f);
@@ -488,6 +488,7 @@ public class NavMeshGenerator implements Savable {
         oc.write(contourMaxDeviation, "contourMaxDeviation", 25);
     }
 
+    @Override
     public void read(JmeImporter im) throws IOException {
         InputCapsule ic = im.getCapsule(this);
         cellSize = ic.readFloat("cellSize", 1f);
@@ -510,9 +511,9 @@ public class NavMeshGenerator implements Savable {
 
     private class MeshBuildRunnable implements Runnable {
 
-        private float[] positions;
-        private int[] indices;
-        private IntermediateData intermediateData;
+        private final float[] positions;
+        private final int[] indices;
+        private final IntermediateData intermediateData;
         private TriangleMesh triMesh;
 
         public MeshBuildRunnable(float[] positions, int[] indices, IntermediateData intermediateData) {

Some files were not shown because too many files changed in this diff