Bladeren bron

SDK :
- fixed polyOffset issue
- fixed FloatPanel spinner having an integer step size

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7963 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

rem..om 14 jaren geleden
bovenliggende
commit
8cc7b13e6b

+ 8 - 3
jme3-materialeditor/src/com/jme3/gde/materials/EditableMaterialFile.java

@@ -131,10 +131,15 @@ public class EditableMaterialFile {
                         String name = lines[0].trim();
                         prop.setName(name);
                         if (additionalRenderStates.get(name) != null) {
+
                             prop.setType(additionalRenderStates.get(name).getType());
                             if (lines.length > 1) {
-                                prop.setValue(lines[lines.length - 1].trim());
-                            }
+                                String value = "";
+                                for (int i = 1; i < lines.length; i++) {
+                                    value += " " + lines[i];
+                                }
+                                prop.setValue(value.trim());
+                            }                           
                             additionalRenderStates.put(prop.getName(), prop);
                         }
                     }
@@ -467,7 +472,7 @@ public class EditableMaterialFile {
         setMatDefName(mat.getMaterialDef().getAssetName());
         createBaseMaterialFile();
         materialParameters.clear();
-        Collection<MatParam> params=mat.getParams();
+        Collection<MatParam> params = mat.getParams();
         for (Iterator<MatParam> it = params.iterator(); it.hasNext();) {
             MatParam matParam = it.next();
             materialParameters.put(matParam.getName(), new MaterialProperty(matParam));

+ 3 - 3
jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.form

@@ -21,7 +21,7 @@
   <Layout>
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
-          <Component id="jToolBar1" alignment="0" pref="168" max="32767" attributes="0"/>
+          <Component id="jToolBar1" alignment="0" pref="543" max="32767" attributes="0"/>
       </Group>
     </DimensionLayout>
     <DimensionLayout dim="1">
@@ -68,12 +68,12 @@
           <Layout>
             <DimensionLayout dim="0">
               <Group type="103" groupAlignment="0" attributes="0">
-                  <EmptySpace min="0" pref="50" max="32767" attributes="0"/>
+                  <EmptySpace min="0" pref="255" max="32767" attributes="0"/>
               </Group>
             </DimensionLayout>
             <DimensionLayout dim="1">
               <Group type="103" groupAlignment="0" attributes="0">
-                  <EmptySpace min="0" pref="28" max="32767" attributes="0"/>
+                  <EmptySpace min="0" pref="25" max="32767" attributes="0"/>
               </Group>
             </DimensionLayout>
           </Layout>

+ 4 - 3
jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/FloatPanel.java

@@ -21,6 +21,7 @@ public class FloatPanel extends MaterialPropertyWidget {
     /** Creates new form NumberPanel */
     public FloatPanel() {
         initComponents();
+           jSpinner1.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.0f), null, null, Float.valueOf(0.1f)));
     }
 
     /** This method is called from within the constructor to
@@ -55,11 +56,11 @@ public class FloatPanel extends MaterialPropertyWidget {
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 50, Short.MAX_VALUE)
+            .addGap(0, 255, Short.MAX_VALUE)
         );
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 28, Short.MAX_VALUE)
+            .addGap(0, 25, Short.MAX_VALUE)
         );
 
         jToolBar1.add(jPanel1);
@@ -76,7 +77,7 @@ public class FloatPanel extends MaterialPropertyWidget {
         this.setLayout(layout);
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)
+            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

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

@@ -16,7 +16,7 @@ import com.jme3.material.RenderState.FaceCullMode;
  */
 public class WidgetFactory {
 
-    public static MaterialPropertyWidget getWidget(MaterialProperty prop, ProjectAssetManager manager){
+    public static MaterialPropertyWidget getWidget(MaterialProperty prop, ProjectAssetManager manager){      
         MaterialPropertyWidget widget;
         if("Texture2D".equals(prop.getType())){
             widget=new TexturePanel(manager);
@@ -68,7 +68,7 @@ public class WidgetFactory {
             widget.setProperty(prop);
             return widget;
         }
-        widget = new TextPanel();
+        widget = new TextPanel();      
         widget.setProperty(prop);
         return widget;
     }