Sfoglia il codice sorgente

Merge branch 'master' into PBRisComing

Nehon 9 anni fa
parent
commit
9885b4d95a

+ 1 - 0
build.gradle

@@ -109,6 +109,7 @@ task createBaseXml(dependsOn: configurations.corelibs) <<{
         dep.dependencyProject.configurations.archives.allArtifacts.each{ artifact->
             if(artifact.classifier == "sources"){
             } else if(artifact.classifier == "javadoc"){
+            } else if(artifact.file.name.endsWith('.pom')) {
             } else{
                 if(!jmeJarFiles.contains(artifact.file)){
                     jmeJarFiles.add(artifact.file)

+ 2 - 2
jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/Bundle.properties

@@ -1,6 +1,6 @@
 CTL_AssetPackBrowserAction=AssetPackBrowser
-CTL_AssetPackBrowserTopComponent=AssetPackBrowser Window
-HINT_AssetPackBrowserTopComponent=This is a AssetPackBrowser window
+CTL_AssetPackBrowserTopComponent=AssetPackBrowser
+HINT_AssetPackBrowserTopComponent=The AssetPackBrowser allows easy managing of your AssetPacks
 AssetPackBrowserTopComponent.jTextField1.text=search
 AssetPackBrowserTopComponent.jButton1.text=update
 AssetPackBrowserTopComponent.jButton2.text=online assetpacks

+ 2 - 2
jme3-core/src/com/jme3/gde/core/appstates/AppStateExplorerTopComponent.java

@@ -67,8 +67,8 @@ persistenceType = TopComponent.PERSISTENCE_ALWAYS)
 preferredID = "AppStateExplorerTopComponent")
 @Messages({
     "CTL_AppStateExplorerAction=AppStateExplorer",
-    "CTL_AppStateExplorerTopComponent=AppStateExplorer Window",
-    "HINT_AppStateExplorerTopComponent=This is a AppStateExplorer window"
+    "CTL_AppStateExplorerTopComponent=AppStateExplorer",
+    "HINT_AppStateExplorerTopComponent=The AppStateExplorer provides an Overview over your current AppState"
 })
 public final class AppStateExplorerTopComponent extends TopComponent implements ExplorerManager.Provider {
 

+ 2 - 2
jme3-core/src/com/jme3/gde/core/filters/Bundle.properties

@@ -1,3 +1,3 @@
 CTL_FilterExplorerAction=FilterExplorer
-CTL_FilterExplorerTopComponent=FilterExplorer Window
-HINT_FilterExplorerTopComponent=This is a FilterExplorer window
+CTL_FilterExplorerTopComponent=FilterExplorer
+HINT_FilterExplorerTopComponent=The FilterExplorer provides an Overview over your current Filter

+ 2 - 2
jme3-core/src/com/jme3/gde/core/sceneexplorer/Bundle.properties

@@ -1,4 +1,4 @@
 CTL_SceneExplorerAction=SceneExplorer
-CTL_SceneExplorerTopComponent=SceneExplorer Window
-HINT_SceneExplorerTopComponent=This is a SceneExplorer window
+CTL_SceneExplorerTopComponent=SceneExplorer
+HINT_SceneExplorerTopComponent=The SceneExplorer provides an Overview over the SceneGraph of your Scene.
 SceneExplorerTopComponent.jButton1.text=update

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

@@ -186,7 +186,7 @@ public class EditableMatDefFile {
             return "";
         } catch (Exception e) {
             Exceptions.printStackTrace(e);
-            return "error generating shader " + e.getMessage();
+            return "Error generating shader: " + e.getMessage();
         }
     }
 

+ 1 - 0
jme3-materialeditor/src/com/jme3/gde/materialdefinition/MatDefDataObject.java

@@ -142,6 +142,7 @@ public class MatDefDataObject extends MultiDataObject {
         findAssetManager();
         final MatDefMetaData metaData = new MatDefMetaData(this);
         lookupContents.add(metaData);
+        lookupContents.add(new MatDefNavigatorPanel());
         pf.addFileChangeListener(new FileChangeAdapter() {
             @Override
             public void fileChanged(FileEvent fe) {

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

@@ -8,6 +8,8 @@ package com.jme3.gde.materialdefinition.editor;
 import com.jme3.gde.materialdefinition.fileStructure.TechniqueBlock;
 import java.awt.Component;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.DefaultListCellRenderer;
 import javax.swing.JLabel;
@@ -23,7 +25,8 @@ public class MatDefEditorToolBar extends javax.swing.JPanel {
 
     private MatDefEditorlElement parent;
     private final DefaultComboBoxModel<TechniqueBlock> comboModel = new DefaultComboBoxModel<TechniqueBlock>();
-
+    private final static Logger logger = Logger.getLogger(MatDefEditorToolBar.class.getName());
+    
     /**
      * Creates new form MatDefEditorToolBar
      */
@@ -130,6 +133,17 @@ public class MatDefEditorToolBar extends javax.swing.JPanel {
     }// </editor-fold>//GEN-END:initComponents
 
     private void techniqueComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_techniqueComboBoxActionPerformed
+        if (techniqueComboBox.getSelectedItem() == null) {
+            if (techniqueComboBox.getItemCount() > 0) {
+                if (techniqueComboBox.getItemCount() > 1) {
+                    logger.log(Level.WARNING, "No Technique selected, taking the first one!"); /* Don't be over verbose: When there's only one Element, you can't select itself again, thus null */
+                }
+                techniqueComboBox.setSelectedIndex(0); /* Take the first one available */
+            } else {
+                logger.log(Level.WARNING, "No Techniques known for this MaterialDef. Please add one using the button to the right!");
+                return;
+            }
+        }
         parent.switchTechnique((TechniqueBlock) techniqueComboBox.getSelectedItem());
     }//GEN-LAST:event_techniqueComboBoxActionPerformed
 

+ 24 - 3
jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/TechniqueBlock.java

@@ -15,6 +15,8 @@ import com.jme3.util.blockparser.Statement;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.openide.util.WeakListeners;
 
 /**
@@ -28,6 +30,8 @@ public class TechniqueBlock extends UberStatement {
     public static final String ADD_WORLD_PARAM = "addWorldParam";
     public static final String REMOVE_WORLD_PARAM = "removeWorldParam";
     protected String name;
+    
+    private static final Logger logger = Logger.getLogger(TechniqueBlock.class.getName());
 
     protected TechniqueBlock(int lineNumber, String line) {
         super(lineNumber, line);
@@ -102,7 +106,13 @@ public class TechniqueBlock extends UberStatement {
     }
 
     public List<WorldParamBlock> getWorldParams() {
-        return getWorldParameters().getWorldParams();
+        WorldParametersBlock block = getWorldParameters();
+        if (block != null)
+            return getWorldParameters().getWorldParams();
+        else {
+            logger.log(Level.WARNING, "Unable to build ShaderNodes: Could not find any WorldParameters. Most likely the technique {0} is broken.", line);
+            return new ArrayList<WorldParamBlock>();
+        }
     }
 
     public void addWorldParam(WorldParamBlock block) {
@@ -180,8 +190,19 @@ public class TechniqueBlock extends UberStatement {
 
     public List<ShaderNodeBlock> getShaderNodes() {
         List<ShaderNodeBlock> list = new ArrayList<ShaderNodeBlock>();
-        list.addAll(getBlock(VertexShaderNodesBlock.class).getShaderNodes());
-        list.addAll(getBlock(FragmentShaderNodesBlock.class).getShaderNodes());
+        
+        VertexShaderNodesBlock vert_block = getBlock(VertexShaderNodesBlock.class);
+        if (vert_block == null)
+            logger.log(Level.WARNING, "Unable to build ShaderNodes: Could not find any VertexShaderNode. Most likely the technique {0} is broken.", line);
+        else
+            list.addAll(vert_block.getShaderNodes());
+        
+        FragmentShaderNodesBlock frag_block = getBlock(FragmentShaderNodesBlock.class);
+        if (frag_block == null)
+            logger.log(Level.WARNING, "Unable to build ShaderNodes: Could not find any FragmentShaderNode. Most likely the technique {0} is broken.", line);
+        else
+            list.addAll(frag_block.getShaderNodes());
+        
         return list;
     }
 

+ 3 - 2
jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java

@@ -148,7 +148,7 @@ public class MaterialPreviewRenderer implements SceneListener {
         });
     }
 
-    private int lastErrorHash = 0;
+    private static int lastErrorHash = 0;
 
     private void smartLog(String expText, String message) {
         int hash = message.hashCode();
@@ -183,7 +183,8 @@ public class MaterialPreviewRenderer implements SceneListener {
             //compilation error, the shader code will be output to the console
             //the following code will output the error
             //System.err.println(e.getMessage());
-            Logger.getLogger(MaterialDebugAppState.class.getName()).log(Level.SEVERE, e.getMessage());
+            //Logger.getLogger(MaterialDebugAppState.class.getName()).log(Level.SEVERE, e.getMessage());
+            smartLog("{0}", e.getMessage());
 
             java.awt.EventQueue.invokeLater(new Runnable() {
                 public void run() {

+ 65 - 20
jme3-terrain-editor/src/com/jme3/gde/terraineditor/sky/SkyboxWizardPanel2.java

@@ -32,14 +32,16 @@
 package com.jme3.gde.terraineditor.sky;
 
 import com.jme3.math.Vector3f;
+import com.jme3.texture.Image;
 import com.jme3.texture.Texture;
 import java.awt.Component;
 import javax.swing.event.ChangeListener;
 import org.openide.WizardDescriptor;
+import org.openide.WizardValidationException;
 import org.openide.util.HelpCtx;
 
 @SuppressWarnings({"unchecked", "rawtypes"})
-public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
+public class SkyboxWizardPanel2 implements WizardDescriptor.ValidatingPanel<WizardDescriptor> {
 
     /**
      * The visual component that displays this panel. If you need to access the
@@ -76,10 +78,12 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
         // fireChangeEvent();
         // and uncomment the complicated stuff below.
     }
-
+    
+    @Override
     public final void addChangeListener(ChangeListener l) {
     }
-
+    
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     }
     /*
@@ -105,14 +109,56 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
     }
     }
      */
-
+    
+    @Override
+    public void validate() throws WizardValidationException {
+        SkyboxVisualPanel2 sky = (SkyboxVisualPanel2)component;
+        
+        /* Check if there are empty textures */
+        if (multipleTextures) {
+            if (sky.getEditorNorth().getAsText() == null) { throw new WizardValidationException(null, " Texture North: Missing texture!", null); }
+            if (sky.getEditorSouth().getAsText() == null) { throw new WizardValidationException(null, " Texture South: Missing texture!", null); }
+            if (sky.getEditorWest().getAsText() == null) { throw new WizardValidationException(null, " Texture West: Missing texture!", null); }
+            if (sky.getEditorEast().getAsText() == null) { throw new WizardValidationException(null, " Texture East: Missing texture!", null); }
+            if (sky.getEditorTop().getAsText() == null) { throw new WizardValidationException(null, " Texture Top: Missing texture!", null); }
+            if (sky.getEditorBottom().getAsText() == null) { throw new WizardValidationException(null, " Texture Bottom: Missing texture!", null); }
+            
+            /* Prevent Null-Pointer Exception. If this is triggered, the Texture has no Image or the AssetKey is invalid (which should never happen) */
+            if (sky.getEditorNorth().getValue() == null || ((Texture)sky.getEditorNorth().getValue()).getImage() == null) { throw new WizardValidationException(null, " Texture North: Cannot load texture!", null); }
+            if (sky.getEditorSouth().getValue() == null || ((Texture)sky.getEditorSouth().getValue()).getImage() == null) { throw new WizardValidationException(null, " Texture South: Cannot load texture!", null); }
+            if (sky.getEditorWest().getValue() == null || ((Texture)sky.getEditorWest().getValue()).getImage() == null) { throw new WizardValidationException(null, " Texture West: Cannot load texture!", null); }
+            if (sky.getEditorEast().getValue() == null || ((Texture)sky.getEditorEast().getValue()).getImage() == null) { throw new WizardValidationException(null, " Texture East: Cannot load texture!", null); }
+            if (sky.getEditorTop().getValue() == null || ((Texture)sky.getEditorTop().getValue()).getImage() == null) { throw new WizardValidationException(null, " Texture Top: Cannot load texture!", null); }
+            if (sky.getEditorBottom().getValue() == null || ((Texture)sky.getEditorBottom().getValue()).getImage() == null) { throw new WizardValidationException(null, " Texture Bottom: Cannot load texture!", null); }
+            
+            /* Check for squares */
+            Image I = ((Texture)sky.getEditorNorth().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Texture North: Image has to be a square (width == height)!", null); }
+            I = ((Texture)sky.getEditorSouth().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Texture South: Image has to be a square (width == height)!", null); }
+            I = ((Texture)sky.getEditorWest().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Texture West: Image has to be a square (width == height)!", null); }
+            I = ((Texture)sky.getEditorEast().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Texture East: Image has to be a square (width == height)!", null); }
+            I = ((Texture)sky.getEditorTop().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Texture Top: Image has to be a square (width == height)!", null); }
+            I = ((Texture)sky.getEditorBottom().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Texture Bottom: Image has to be a square (width == height)!", null); }
+        } else {
+            if (sky.getEditorSingle().getAsText() == null){ throw new WizardValidationException(null, " Single Texture: Missing texture!", null); }
+            if (sky.getEditorSingle().getValue() == null || ((Texture)sky.getEditorSingle().getValue()).getImage() == null){ throw new WizardValidationException(null, " Single Texture: Cannot load texture!", null); }
+            Image I = ((Texture)sky.getEditorSingle().getValue()).getImage();
+            if (I.getWidth() != I.getHeight()) { throw new WizardValidationException(null, " Single Texture: Image has to be a square (width == height)!", null); }
+        }
+    }
+    
     // You can use a settings object to keep track of state. Normally the
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
-    public void readSettings(Object settings) {
-        WizardDescriptor wiz = (WizardDescriptor) settings;
-        multipleTextures = (Boolean)wiz.getProperty("multipleTextures");
+    @Override
+    public void readSettings(WizardDescriptor settings) {
+        multipleTextures = (Boolean)settings.getProperty("multipleTextures");
         SkyboxVisualPanel2 comp = (SkyboxVisualPanel2) getComponent();
         if (multipleTextures) {
             comp.getMultipleTexturePanel().setVisible(true);
@@ -124,28 +170,27 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
     }
 
     @Override
-    public void storeSettings(Object settings) {
-        WizardDescriptor wiz = (WizardDescriptor) settings;
+    public void storeSettings(WizardDescriptor settings) {
         SkyboxVisualPanel2 comp = (SkyboxVisualPanel2) getComponent();
         if (multipleTextures) {
-            wiz.putProperty("textureSouth", (Texture)comp.getEditorSouth().getValue());
-            wiz.putProperty("textureNorth", (Texture)comp.getEditorNorth().getValue());
-            wiz.putProperty("textureEast", (Texture)comp.getEditorEast().getValue());
-            wiz.putProperty("textureWest", (Texture)comp.getEditorWest().getValue());
-            wiz.putProperty("textureTop", (Texture)comp.getEditorTop().getValue());
-            wiz.putProperty("textureBottom", (Texture)comp.getEditorBottom().getValue());
+            settings.putProperty("textureSouth", (Texture)comp.getEditorSouth().getValue());
+            settings.putProperty("textureNorth", (Texture)comp.getEditorNorth().getValue());
+            settings.putProperty("textureEast", (Texture)comp.getEditorEast().getValue());
+            settings.putProperty("textureWest", (Texture)comp.getEditorWest().getValue());
+            settings.putProperty("textureTop", (Texture)comp.getEditorTop().getValue());
+            settings.putProperty("textureBottom", (Texture)comp.getEditorBottom().getValue());
             float x = new Float(comp.getNormal1X().getText());
             float y = new Float(comp.getNormal1Y().getText());
             float z = new Float(comp.getNormal1Z().getText());
-            wiz.putProperty("normalScale", new Vector3f(x,y,z) );
+            settings.putProperty("normalScale", new Vector3f(x,y,z) );
         } else {
-            wiz.putProperty("textureSingle", (Texture)comp.getEditorSingle().getValue());
+            settings.putProperty("textureSingle", (Texture)comp.getEditorSingle().getValue());
             float x = new Float(comp.getNormal2X().getText());
             float y = new Float(comp.getNormal2Y().getText());
             float z = new Float(comp.getNormal2Z().getText());
-            wiz.putProperty("normalScale", new Vector3f(x,y,z) );
-            wiz.putProperty("envMapType", comp.getEnvMapType());         
-            wiz.putProperty("flipY", comp.getFlipYCheckBox().isSelected());
+            settings.putProperty("normalScale", new Vector3f(x,y,z) );
+            settings.putProperty("envMapType", comp.getEnvMapType());         
+            settings.putProperty("flipY", comp.getFlipYCheckBox().isSelected());
         }
     }
 }

+ 1 - 1
jme3-welcome-screen/src/com/jme3/gde/welcome/Bundle.properties

@@ -3,6 +3,6 @@ OpenIDE-Module-Long-Description=\
     The jMonkeyEngine GDE Welcome Screen
 OpenIDE-Module-Name=Welcome Screen
 OpenIDE-Module-Short-Description=The jMonkeyEngine GDE Welcome Screen
-WelcomeScreenTopComponent.http.link=http://hub.jmonkeyengine.org/wiki/doku.php/sdk:welcome:3_0?do=export_xhtmlbody
+WelcomeScreenTopComponent.http.link=http://hub.jmonkeyengine.org/wiki/doku.php/sdk:welcome:3_1?do=export_xhtmlbody
 WelcomeScreenTopComponent.rss.link=http://hub.jmonkeyengine.org/feed/rdf/
 WelcomeScreenTopComponent.local.link=nbres:/com/jme3/gde/docs/sdk/welcome/local.html