Browse Source

Merge remote-tracking branch 'upstream/master' into exp_bintray2

David Bernard 9 years ago
parent
commit
86024d8310

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

@@ -1,6 +1,6 @@
 CTL_AssetPackBrowserAction=AssetPackBrowser
 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.jTextField1.text=search
 AssetPackBrowserTopComponent.jButton1.text=update
 AssetPackBrowserTopComponent.jButton1.text=update
 AssetPackBrowserTopComponent.jButton2.text=online assetpacks
 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")
 preferredID = "AppStateExplorerTopComponent")
 @Messages({
 @Messages({
     "CTL_AppStateExplorerAction=AppStateExplorer",
     "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 {
 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_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_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
 SceneExplorerTopComponent.jButton1.text=update

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

@@ -32,14 +32,16 @@
 package com.jme3.gde.terraineditor.sky;
 package com.jme3.gde.terraineditor.sky;
 
 
 import com.jme3.math.Vector3f;
 import com.jme3.math.Vector3f;
+import com.jme3.texture.Image;
 import com.jme3.texture.Texture;
 import com.jme3.texture.Texture;
 import java.awt.Component;
 import java.awt.Component;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.ChangeListener;
 import org.openide.WizardDescriptor;
 import org.openide.WizardDescriptor;
+import org.openide.WizardValidationException;
 import org.openide.util.HelpCtx;
 import org.openide.util.HelpCtx;
 
 
 @SuppressWarnings({"unchecked", "rawtypes"})
 @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
      * The visual component that displays this panel. If you need to access the
@@ -76,10 +78,12 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
         // fireChangeEvent();
         // fireChangeEvent();
         // and uncomment the complicated stuff below.
         // and uncomment the complicated stuff below.
     }
     }
-
+    
+    @Override
     public final void addChangeListener(ChangeListener l) {
     public final void addChangeListener(ChangeListener l) {
     }
     }
-
+    
+    @Override
     public final void removeChangeListener(ChangeListener l) {
     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
     // You can use a settings object to keep track of state. Normally the
     // settings object will be the WizardDescriptor, so you can use
     // settings object will be the WizardDescriptor, so you can use
     // WizardDescriptor.getProperty & putProperty to store information entered
     // WizardDescriptor.getProperty & putProperty to store information entered
     // by the user.
     // 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();
         SkyboxVisualPanel2 comp = (SkyboxVisualPanel2) getComponent();
         if (multipleTextures) {
         if (multipleTextures) {
             comp.getMultipleTexturePanel().setVisible(true);
             comp.getMultipleTexturePanel().setVisible(true);
@@ -124,28 +170,27 @@ public class SkyboxWizardPanel2 implements WizardDescriptor.Panel {
     }
     }
 
 
     @Override
     @Override
-    public void storeSettings(Object settings) {
-        WizardDescriptor wiz = (WizardDescriptor) settings;
+    public void storeSettings(WizardDescriptor settings) {
         SkyboxVisualPanel2 comp = (SkyboxVisualPanel2) getComponent();
         SkyboxVisualPanel2 comp = (SkyboxVisualPanel2) getComponent();
         if (multipleTextures) {
         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 x = new Float(comp.getNormal1X().getText());
             float y = new Float(comp.getNormal1Y().getText());
             float y = new Float(comp.getNormal1Y().getText());
             float z = new Float(comp.getNormal1Z().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 {
         } else {
-            wiz.putProperty("textureSingle", (Texture)comp.getEditorSingle().getValue());
+            settings.putProperty("textureSingle", (Texture)comp.getEditorSingle().getValue());
             float x = new Float(comp.getNormal2X().getText());
             float x = new Float(comp.getNormal2X().getText());
             float y = new Float(comp.getNormal2Y().getText());
             float y = new Float(comp.getNormal2Y().getText());
             float z = new Float(comp.getNormal2Z().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());
         }
         }
     }
     }
 }
 }