浏览代码

Downgrading OGRE Script to fix incompatibilities with Blender and add a Template for BaseAppState (#136)

* Downgrade OGRE Export Script
* Added new BaseAppState template
mitm001 8 年之前
父节点
当前提交
63bdf1c959

文件差异内容过多而无法显示
+ 132 - 399
jme3-ogretools/scripts/io_export_ogreDotScene.py


+ 14 - 0
jme3-templates/src/com/jme3/gde/templates/files/BaseAppState.html

@@ -0,0 +1,14 @@
+<!--
+To change this template, choose Tools | Templates
+and open the template in the editor.
+-->
+<!DOCTYPE html>
+<html>
+    <head>
+        <title></title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    </head>
+    <body>
+        <div>A generic AppState that allows adding global behavior to your application.</div>
+    </body>
+</html>

+ 55 - 0
jme3-templates/src/com/jme3/gde/templates/files/BaseAppState.template

@@ -0,0 +1,55 @@
+<#assign licenseFirst = "/*">
+<#assign licensePrefix = " * ">
+<#assign licenseLast = " */">
+<#include "../Licenses/license-${project.license}.txt">
+
+<#if package?? && package != "">
+package ${package};
+
+</#if>
+import com.jme3.app.Application;
+import com.jme3.app.state.BaseAppState;
+
+/** 
+ * 
+ * @author ${user} 
+ */
+public class ${name} extends BaseAppState {        
+    
+    @Override    
+    protected void initialize(Application app) {        
+        //It is technically safe to do all initialization and cleanup in the         
+        //onEnable()/onDisable() methods. Choosing to use initialize() and         
+        //cleanup() for this is a matter of performance specifics for the         
+        //implementor.        
+        //TODO: initialize your AppState, e.g. attach spatials to rootNode    
+    }
+    
+    @Override    
+    protected void cleanup(Application app) {        
+        //TODO: clean up what you initialized in the initialize method,        
+        //e.g. remove all spatials from rootNode    
+    }
+    
+    //onEnable()/onDisable() can be used for managing things that should     
+    //only exist while the state is enabled. Prime examples would be scene     
+    //graph attachment or input listener attachment.    
+    @Override    
+    protected void onEnable() {        
+        //Called when the state is fully enabled, ie: is attached and         
+        //isEnabled() is true or when the setEnabled() status changes after the         
+        //state is attached.    
+    }
+    
+    @Override    
+    protected void onDisable() {        
+        //Called when the state was previously enabled but is now disabled         
+        //either because setEnabled(false) was called or the state is being         
+        //cleaned up.    
+    }        
+    
+    @Override    
+    public void update(float tpf) {        
+        //TODO: implement behavior during runtime    
+    }    
+}

+ 11 - 0
jme3-templates/src/com/jme3/gde/templates/layer.xml

@@ -38,6 +38,17 @@
                 <!--attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.java.project.Bundle"/-->
                 <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/java/resources/class.gif"/>
             </file>
+            <file name="BaseAppState.java" url="files/BaseAppState.template">                
+                <attr name="displayName" stringvalue="New BaseAppState"/>
+                <attr name="instantiatingIterator" methodvalue="org.netbeans.spi.java.project.support.ui.templates.JavaTemplates.createJavaTemplateIterator"/>
+                <attr name="position" intvalue="300"/>
+                <attr name="templateCategory" stringvalue="java-classes, java-classes-basic"/>
+                <attr name="template" boolvalue="true"/>
+                <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/>
+                <attr name="templateWizardURL" urlvalue="nbresloc:/com/jme3/gde/templates/files/BaseAppState.html"/>
+                <!--attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.java.project.Bundle"/-->
+                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/java/resources/class.gif"/>
+            </file>
         </folder>
     </folder>
 </filesystem>

部分文件因为文件数量过多而无法显示