Browse Source

Enhanced the ShaderNodeDefinition creation wizard

Nehon 10 years ago
parent
commit
3d79ec0dee

BIN
jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/add.png


BIN
jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/remove.png


+ 5 - 1
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/SNDefTemplate.j3sn

@@ -1,7 +1,11 @@
 ShaderNodeDefinitions{ 
 ShaderNodeDefinitions{ 
     ShaderNodeDefinition ${defName} {      
     ShaderNodeDefinition ${defName} {      
         Type: ${defType}
         Type: ${defType}
-        Shader GLSL100: ${shaderSnippet}
+
+        <#list glslVersions as version>                
+        Shader GLSL${version}: ${shaderSnippet}${version}${ext}
+        </#list>
+        
         Documentation{
         Documentation{
             ${description}            
             ${description}            
             <#list inputParams as param>                
             <#list inputParams as param>                

+ 0 - 13
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/sNDef.html

@@ -1,13 +0,0 @@
-<!--
-To change this license header, choose License Headers in Project Properties.
-To change this template file, choose Tools | Templates
-and open the template in the editor.
--->
-<html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    </head>
-    <body>        
-        A new Shader Node Definition file that can be instantiated as a Shader Node in the Shader Node editor
-    </body>
-</html>

+ 11 - 2
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/Bundle.properties

@@ -3,8 +3,17 @@ SNDefVisualPanel1.defNameTextField.toolTipText=
 SNDefVisualPanel1.defNameTextField.text=
 SNDefVisualPanel1.defNameTextField.text=
 SNDefVisualPanel1.jLabel2.text=Shader type
 SNDefVisualPanel1.jLabel2.text=Shader type
 SNDefVisualPanel1.jPanel2.border.title=Description
 SNDefVisualPanel1.jPanel2.border.title=Description
-SNDefVisualPanel2.addButton.text=
+SNDefVisualPanel2.addButton.text=Add
 SNDefVisualPanel2.titleLabel.text=Inputs
 SNDefVisualPanel2.titleLabel.text=Inputs
 SNDefVisualPanel2.addButton.toolTipText=Add an entry
 SNDefVisualPanel2.addButton.toolTipText=Add an entry
 SNDefVisualPanel2.delButton.toolTipText=Delete an entry
 SNDefVisualPanel2.delButton.toolTipText=Delete an entry
-SNDefVisualPanel2.delButton.text=
+SNDefVisualPanel2.delButton.text=Remove
+SNDefVisualPanel1.jLabel3.text=Glsl version
+SNDefVisualPanel1.glsl100.text=1.0
+SNDefVisualPanel1.glsl110.text=1.1
+SNDefVisualPanel1.glsl120.text=1.2
+SNDefVisualPanel1.glsl130.text=1.3
+SNDefVisualPanel1.glsl140.text=1.4
+SNDefVisualPanel1.glsl150.text=1.5
+SNDefVisualPanel1.glslCustom.text=custom
+SNDefVisualPanel1.customGlslVer.text=

+ 116 - 12
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.form

@@ -31,22 +31,46 @@
       <Layout>
       <Layout>
         <DimensionLayout dim="0">
         <DimensionLayout dim="0">
           <Group type="103" groupAlignment="0" attributes="0">
           <Group type="103" groupAlignment="0" attributes="0">
-              <Group type="102" alignment="1" attributes="0">
+              <Group type="102" attributes="0">
                   <Group type="103" groupAlignment="1" attributes="0">
                   <Group type="103" groupAlignment="1" attributes="0">
-                      <Group type="102" attributes="0">
+                      <Group type="102" alignment="1" attributes="0">
                           <EmptySpace max="-2" attributes="0"/>
                           <EmptySpace max="-2" attributes="0"/>
                           <Component id="jPanel2" max="32767" attributes="0"/>
                           <Component id="jPanel2" max="32767" attributes="0"/>
                       </Group>
                       </Group>
-                      <Group type="102" attributes="0">
+                      <Group type="102" alignment="0" attributes="0">
                           <EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
                           <EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
-                          <Group type="103" groupAlignment="1" attributes="0">
-                              <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
-                              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
-                          </Group>
-                          <EmptySpace max="-2" attributes="0"/>
                           <Group type="103" groupAlignment="0" attributes="0">
                           <Group type="103" groupAlignment="0" attributes="0">
-                              <Component id="defNameTextField" max="32767" attributes="0"/>
-                              <Component id="shaderTypeCB" max="32767" attributes="0"/>
+                              <Group type="102" attributes="0">
+                                  <EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
+                                  <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                                  <Component id="glsl100" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Component id="glsl110" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                                  <Component id="glsl120" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                                  <Component id="glsl130" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Component id="glsl140" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Component id="glsl150" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace pref="18" max="32767" attributes="0"/>
+                                  <Component id="glslCustom" min="-2" max="-2" attributes="0"/>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Component id="customGlslVer" min="-2" pref="37" max="-2" attributes="0"/>
+                              </Group>
+                              <Group type="102" attributes="0">
+                                  <Group type="103" groupAlignment="1" attributes="0">
+                                      <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
+                                      <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+                                  </Group>
+                                  <EmptySpace max="-2" attributes="0"/>
+                                  <Group type="103" groupAlignment="0" attributes="0">
+                                      <Component id="defNameTextField" max="32767" attributes="0"/>
+                                      <Component id="shaderTypeCB" max="32767" attributes="0"/>
+                                  </Group>
+                              </Group>
                           </Group>
                           </Group>
                       </Group>
                       </Group>
                   </Group>
                   </Group>
@@ -57,7 +81,7 @@
         <DimensionLayout dim="1">
         <DimensionLayout dim="1">
           <Group type="103" groupAlignment="0" attributes="0">
           <Group type="103" groupAlignment="0" attributes="0">
               <Group type="102" alignment="0" attributes="0">
               <Group type="102" alignment="0" attributes="0">
-                  <EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
                   <Group type="103" groupAlignment="3" attributes="0">
                   <Group type="103" groupAlignment="3" attributes="0">
                       <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="defNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="defNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -68,6 +92,18 @@
                       <Component id="shaderTypeCB" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="shaderTypeCB" alignment="3" min="-2" max="-2" attributes="0"/>
                   </Group>
                   </Group>
                   <EmptySpace max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="customGlslVer" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glsl110" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glsl100" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glsl120" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glsl130" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glsl150" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glsl140" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="glslCustom" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
                   <Component id="jPanel2" max="32767" attributes="0"/>
                   <Component id="jPanel2" max="32767" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
               </Group>
               </Group>
@@ -125,7 +161,7 @@
           <Layout>
           <Layout>
             <DimensionLayout dim="0">
             <DimensionLayout dim="0">
               <Group type="103" groupAlignment="0" attributes="0">
               <Group type="103" groupAlignment="0" attributes="0">
-                  <Component id="jScrollPane1" alignment="0" pref="376" max="32767" attributes="0"/>
+                  <Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
               </Group>
               </Group>
             </DimensionLayout>
             </DimensionLayout>
             <DimensionLayout dim="1">
             <DimensionLayout dim="1">
@@ -152,6 +188,74 @@
             </Container>
             </Container>
           </SubComponents>
           </SubComponents>
         </Container>
         </Container>
+        <Component class="javax.swing.JTextField" name="customGlslVer">
+          <Properties>
+            <Property name="editable" type="boolean" value="false"/>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.customGlslVer.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glsl110">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glsl110.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glsl100">
+          <Properties>
+            <Property name="selected" type="boolean" value="true"/>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glsl100.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glsl120">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glsl120.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glsl130">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glsl130.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glsl150">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glsl150.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glsl140">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glsl140.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel3">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.jLabel3.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JCheckBox" name="glslCustom">
+          <Properties>
+            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+              <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel1.glslCustom.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+            </Property>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="glslCustomActionPerformed"/>
+          </Events>
+        </Component>
       </SubComponents>
       </SubComponents>
     </Container>
     </Container>
   </SubComponents>
   </SubComponents>

+ 126 - 11
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.java

@@ -6,6 +6,8 @@
 package com.jme3.gde.shadernodedefinition.wizard;
 package com.jme3.gde.shadernodedefinition.wizard;
 
 
 import com.jme3.shader.Shader;
 import com.jme3.shader.Shader;
+import java.util.ArrayList;
+import java.util.List;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JPanel;
 import javax.swing.JPanel;
 
 
@@ -20,7 +22,9 @@ public final class SNDefVisualPanel1 extends JPanel {
         initComponents();
         initComponents();
         DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
         DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
         for (Shader.ShaderType shaderType : Shader.ShaderType.values()) {
         for (Shader.ShaderType shaderType : Shader.ShaderType.values()) {
-            model.addElement(shaderType.name());
+            if(!shaderType.name().equalsIgnoreCase("geometry")){//hack to not have geometry shader remove that when geometry shader are in
+                model.addElement(shaderType.name());
+            }
         }
         }
         shaderTypeCB.setModel(model);
         shaderTypeCB.setModel(model);
     }
     }
@@ -42,6 +46,34 @@ public final class SNDefVisualPanel1 extends JPanel {
         return descriptionTextArea.getText();
         return descriptionTextArea.getText();
     }
     }
     
     
+    public List<String> getGlslVersions(){
+        List<String> versions = new ArrayList<String>();
+        
+        if(glsl100.isSelected()){
+            versions.add("100");
+        }
+        if(glsl110.isSelected()){
+            versions.add("110");
+        }
+        if(glsl120.isSelected()){
+            versions.add("120");
+        }
+        if(glsl130.isSelected()){
+            versions.add("130");
+        }
+        if(glsl140.isSelected()){
+            versions.add("140");
+        }
+        if(glsl150.isSelected()){
+            versions.add("150");
+        }
+        if(glslCustom.isSelected()){
+            versions.add(customGlslVer.getText().replace(".", "")+"0");
+        }
+        
+        
+        return versions;
+    }
     
     
     /**
     /**
      * This method is called from within the constructor to initialize the form.
      * This method is called from within the constructor to initialize the form.
@@ -59,6 +91,15 @@ public final class SNDefVisualPanel1 extends JPanel {
         jPanel2 = new javax.swing.JPanel();
         jPanel2 = new javax.swing.JPanel();
         jScrollPane1 = new javax.swing.JScrollPane();
         jScrollPane1 = new javax.swing.JScrollPane();
         descriptionTextArea = new javax.swing.JTextArea();
         descriptionTextArea = new javax.swing.JTextArea();
+        customGlslVer = new javax.swing.JTextField();
+        glsl110 = new javax.swing.JCheckBox();
+        glsl100 = new javax.swing.JCheckBox();
+        glsl120 = new javax.swing.JCheckBox();
+        glsl130 = new javax.swing.JCheckBox();
+        glsl150 = new javax.swing.JCheckBox();
+        glsl140 = new javax.swing.JCheckBox();
+        jLabel3 = new javax.swing.JLabel();
+        glslCustom = new javax.swing.JCheckBox();
 
 
         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.jLabel1.text")); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.jLabel1.text")); // NOI18N
 
 
@@ -79,37 +120,83 @@ public final class SNDefVisualPanel1 extends JPanel {
         jPanel2.setLayout(jPanel2Layout);
         jPanel2.setLayout(jPanel2Layout);
         jPanel2Layout.setHorizontalGroup(
         jPanel2Layout.setHorizontalGroup(
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
+            .addComponent(jScrollPane1)
         );
         );
         jPanel2Layout.setVerticalGroup(
         jPanel2Layout.setVerticalGroup(
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
             .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
         );
         );
 
 
+        customGlslVer.setEditable(false);
+        customGlslVer.setText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.customGlslVer.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(glsl110, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glsl110.text")); // NOI18N
+
+        glsl100.setSelected(true);
+        org.openide.awt.Mnemonics.setLocalizedText(glsl100, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glsl100.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(glsl120, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glsl120.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(glsl130, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glsl130.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(glsl150, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glsl150.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(glsl140, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glsl140.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.jLabel3.text")); // NOI18N
+
+        org.openide.awt.Mnemonics.setLocalizedText(glslCustom, org.openide.util.NbBundle.getMessage(SNDefVisualPanel1.class, "SNDefVisualPanel1.glslCustom.text")); // NOI18N
+        glslCustom.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                glslCustomActionPerformed(evt);
+            }
+        });
+
         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
         jPanel1.setLayout(jPanel1Layout);
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
         jPanel1Layout.setHorizontalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
+            .addGroup(jPanel1Layout.createSequentialGroup()
                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                     .addGroup(jPanel1Layout.createSequentialGroup()
                     .addGroup(jPanel1Layout.createSequentialGroup()
                         .addContainerGap()
                         .addContainerGap()
                         .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                         .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-                    .addGroup(jPanel1Layout.createSequentialGroup()
+                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                         .addGap(14, 14, 14)
                         .addGap(14, 14, 14)
-                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
-                            .addComponent(jLabel2)
-                            .addComponent(jLabel1))
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                            .addComponent(defNameTextField)
-                            .addComponent(shaderTypeCB, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
+                            .addGroup(jPanel1Layout.createSequentialGroup()
+                                .addGap(19, 19, 19)
+                                .addComponent(jLabel3)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                                .addComponent(glsl100)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(glsl110)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                                .addComponent(glsl120)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                                .addComponent(glsl130)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(glsl140)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(glsl150)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
+                                .addComponent(glslCustom)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(customGlslVer, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addGroup(jPanel1Layout.createSequentialGroup()
+                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+                                    .addComponent(jLabel2)
+                                    .addComponent(jLabel1))
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                                    .addComponent(defNameTextField)
+                                    .addComponent(shaderTypeCB, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
                 .addContainerGap())
                 .addContainerGap())
         );
         );
         jPanel1Layout.setVerticalGroup(
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(jPanel1Layout.createSequentialGroup()
             .addGroup(jPanel1Layout.createSequentialGroup()
-                .addGap(40, 40, 40)
+                .addContainerGap()
                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(jLabel1)
                     .addComponent(jLabel1)
                     .addComponent(defNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                     .addComponent(defNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
@@ -118,6 +205,17 @@ public final class SNDefVisualPanel1 extends JPanel {
                     .addComponent(jLabel2)
                     .addComponent(jLabel2)
                     .addComponent(shaderTypeCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                     .addComponent(shaderTypeCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(customGlslVer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(glsl110)
+                    .addComponent(glsl100)
+                    .addComponent(glsl120)
+                    .addComponent(glsl130)
+                    .addComponent(glsl150)
+                    .addComponent(glsl140)
+                    .addComponent(jLabel3)
+                    .addComponent(glslCustom))
+                .addGap(7, 7, 7)
                 .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addContainerGap())
                 .addContainerGap())
         );
         );
@@ -134,11 +232,28 @@ public final class SNDefVisualPanel1 extends JPanel {
         );
         );
     }// </editor-fold>//GEN-END:initComponents
     }// </editor-fold>//GEN-END:initComponents
 
 
+    private void glslCustomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_glslCustomActionPerformed
+        if (glslCustom.isSelected()) {
+            customGlslVer.setEditable(true);
+        }else{
+            customGlslVer.setEditable(false);
+        }
+    }//GEN-LAST:event_glslCustomActionPerformed
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JTextField customGlslVer;
     private javax.swing.JTextField defNameTextField;
     private javax.swing.JTextField defNameTextField;
     private javax.swing.JTextArea descriptionTextArea;
     private javax.swing.JTextArea descriptionTextArea;
+    private javax.swing.JCheckBox glsl100;
+    private javax.swing.JCheckBox glsl110;
+    private javax.swing.JCheckBox glsl120;
+    private javax.swing.JCheckBox glsl130;
+    private javax.swing.JCheckBox glsl140;
+    private javax.swing.JCheckBox glsl150;
+    private javax.swing.JCheckBox glslCustom;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JLabel jLabel2;
+    private javax.swing.JLabel jLabel3;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JPanel jPanel2;
     private javax.swing.JPanel jPanel2;
     private javax.swing.JScrollPane jScrollPane1;
     private javax.swing.JScrollPane jScrollPane1;

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

@@ -16,84 +16,52 @@
   <Layout>
   <Layout>
     <DimensionLayout dim="0">
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
       <Group type="103" groupAlignment="0" attributes="0">
-          <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
+          <Component id="jToolBar1" max="32767" attributes="0"/>
+          <Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/>
       </Group>
       </Group>
     </DimensionLayout>
     </DimensionLayout>
     <DimensionLayout dim="1">
     <DimensionLayout dim="1">
       <Group type="103" groupAlignment="0" attributes="0">
       <Group type="103" groupAlignment="0" attributes="0">
-          <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
+          <Group type="102" alignment="0" attributes="0">
+              <Component id="jToolBar1" min="-2" pref="25" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jScrollPane1" pref="455" max="32767" attributes="0"/>
+          </Group>
       </Group>
       </Group>
     </DimensionLayout>
     </DimensionLayout>
   </Layout>
   </Layout>
   <SubComponents>
   <SubComponents>
-    <Container class="javax.swing.JPanel" name="jPanel1">
+    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+      <AuxValues>
+        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+      </AuxValues>
 
 
-      <Layout>
-        <DimensionLayout dim="0">
-          <Group type="103" groupAlignment="0" attributes="0">
-              <Group type="102" attributes="0">
-                  <EmptySpace max="-2" attributes="0"/>
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <Component id="jScrollPane1" pref="388" max="32767" attributes="0"/>
-                      <Group type="102" attributes="0">
-                          <Component id="titleLabel" min="-2" max="-2" attributes="0"/>
-                          <EmptySpace max="32767" attributes="0"/>
-                          <Component id="addButton" min="-2" max="-2" attributes="0"/>
-                          <EmptySpace max="-2" attributes="0"/>
-                          <Component id="delButton" min="-2" max="-2" attributes="0"/>
-                      </Group>
-                  </Group>
-                  <EmptySpace max="-2" attributes="0"/>
-              </Group>
-          </Group>
-        </DimensionLayout>
-        <DimensionLayout dim="1">
-          <Group type="103" groupAlignment="0" attributes="0">
-              <Group type="102" alignment="1" attributes="0">
-                  <Group type="103" groupAlignment="0" attributes="0">
-                      <Group type="102" attributes="0">
-                          <EmptySpace max="32767" attributes="0"/>
-                          <Component id="titleLabel" min="-2" max="-2" attributes="0"/>
-                      </Group>
-                      <Group type="102" alignment="1" attributes="0">
-                          <Component id="delButton" min="-2" max="-2" attributes="0"/>
-                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
-                      </Group>
-                      <Group type="102" alignment="0" attributes="0">
-                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
-                          <Component id="addButton" min="-2" max="-2" attributes="0"/>
-                      </Group>
-                  </Group>
-                  <EmptySpace max="-2" attributes="0"/>
-                  <Component id="jScrollPane1" min="-2" pref="278" max="-2" attributes="0"/>
-              </Group>
-          </Group>
-        </DimensionLayout>
-      </Layout>
+      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
       <SubComponents>
       <SubComponents>
-        <Container class="javax.swing.JScrollPane" name="jScrollPane1">
-          <AuxValues>
-            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
-          </AuxValues>
+        <Component class="javax.swing.JTable" name="varTable">
+          <Properties>
+            <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+              <Color blue="ee" green="ee" id="Label.background" palette="3" red="ee" type="palette"/>
+            </Property>
+            <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
+              <Table columnCount="3" rowCount="0">
+                <Column editable="true" title="Type" type="java.lang.String"/>
+                <Column editable="true" title="Name" type="java.lang.String"/>
+                <Column editable="true" title="Description" type="java.lang.String"/>
+              </Table>
+            </Property>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+    <Container class="javax.swing.JToolBar" name="jToolBar1">
+      <Properties>
+        <Property name="floatable" type="boolean" value="false"/>
+        <Property name="rollover" type="boolean" value="true"/>
+      </Properties>
 
 
-          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
-          <SubComponents>
-            <Component class="javax.swing.JTable" name="varTable">
-              <Properties>
-                <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
-                  <Color blue="ee" green="ee" id="Label.background" palette="3" red="ee" type="palette"/>
-                </Property>
-                <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
-                  <Table columnCount="3" rowCount="0">
-                    <Column editable="true" title="Type" type="java.lang.String"/>
-                    <Column editable="true" title="Name" type="java.lang.String"/>
-                    <Column editable="true" title="Description" type="java.lang.String"/>
-                  </Table>
-                </Property>
-              </Properties>
-            </Component>
-          </SubComponents>
-        </Container>
+      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
+      <SubComponents>
         <Component class="javax.swing.JLabel" name="titleLabel">
         <Component class="javax.swing.JLabel" name="titleLabel">
           <Properties>
           <Properties>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@@ -101,10 +69,28 @@
             </Property>
             </Property>
           </Properties>
           </Properties>
         </Component>
         </Component>
+        <Container class="javax.swing.JPanel" name="jPanel1">
+          <Properties>
+            <Property name="opaque" type="boolean" value="false"/>
+          </Properties>
+
+          <Layout>
+            <DimensionLayout dim="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <EmptySpace min="0" pref="412" max="32767" attributes="0"/>
+              </Group>
+            </DimensionLayout>
+            <DimensionLayout dim="1">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <EmptySpace min="0" pref="21" max="32767" attributes="0"/>
+              </Group>
+            </DimensionLayout>
+          </Layout>
+        </Container>
         <Component class="javax.swing.JButton" name="addButton">
         <Component class="javax.swing.JButton" name="addButton">
           <Properties>
           <Properties>
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
-              <Image iconType="3" name="/com/jme3/gde/materials/multiview/widgets/icons/picture_add.png"/>
+              <Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/add.png"/>
             </Property>
             </Property>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
             <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;)"/>
               <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel2.addButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
@@ -121,7 +107,7 @@
         <Component class="javax.swing.JButton" name="delButton">
         <Component class="javax.swing.JButton" name="delButton">
           <Properties>
           <Properties>
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
             <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
-              <Image iconType="3" name="/com/jme3/gde/materials/multiview/widgets/icons/picture_delete.png"/>
+              <Image iconType="3" name="/com/jme3/gde/materialdefinition/icons/remove.png"/>
             </Property>
             </Property>
             <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
             <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;)"/>
               <ResourceString bundle="com/jme3/gde/shadernodedefinition/wizard/Bundle.properties" key="SNDefVisualPanel2.delButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>

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

@@ -93,10 +93,11 @@ public final class SNDefVisualPanel2 extends JPanel {
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
     private void initComponents() {
     private void initComponents() {
 
 
-        jPanel1 = new javax.swing.JPanel();
         jScrollPane1 = new javax.swing.JScrollPane();
         jScrollPane1 = new javax.swing.JScrollPane();
         varTable = new javax.swing.JTable();
         varTable = new javax.swing.JTable();
+        jToolBar1 = new javax.swing.JToolBar();
         titleLabel = new javax.swing.JLabel();
         titleLabel = new javax.swing.JLabel();
+        jPanel1 = new javax.swing.JPanel();
         addButton = new javax.swing.JButton();
         addButton = new javax.swing.JButton();
         delButton = new javax.swing.JButton();
         delButton = new javax.swing.JButton();
 
 
@@ -119,9 +120,28 @@ public final class SNDefVisualPanel2 extends JPanel {
         });
         });
         jScrollPane1.setViewportView(varTable);
         jScrollPane1.setViewportView(varTable);
 
 
+        jToolBar1.setFloatable(false);
+        jToolBar1.setRollover(true);
+
         org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.titleLabel.text")); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.titleLabel.text")); // NOI18N
+        jToolBar1.add(titleLabel);
+
+        jPanel1.setOpaque(false);
+
+        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+        jPanel1.setLayout(jPanel1Layout);
+        jPanel1Layout.setHorizontalGroup(
+            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 412, Short.MAX_VALUE)
+        );
+        jPanel1Layout.setVerticalGroup(
+            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 21, Short.MAX_VALUE)
+        );
 
 
-        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materials/multiview/widgets/icons/picture_add.png"))); // NOI18N
+        jToolBar1.add(jPanel1);
+
+        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/add.png"))); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(addButton, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.text")); // 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.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.toolTipText")); // NOI18N
         addButton.setAlignmentX(0.5F);
         addButton.setAlignmentX(0.5F);
@@ -130,8 +150,9 @@ public final class SNDefVisualPanel2 extends JPanel {
                 addButtonActionPerformed(evt);
                 addButtonActionPerformed(evt);
             }
             }
         });
         });
+        jToolBar1.add(addButton);
 
 
-        delButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materials/multiview/widgets/icons/picture_delete.png"))); // NOI18N
+        delButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/remove.png"))); // NOI18N
         org.openide.awt.Mnemonics.setLocalizedText(delButton, org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.text")); // 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.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.toolTipText")); // NOI18N
         delButton.setAlignmentX(0.5F);
         delButton.setAlignmentX(0.5F);
@@ -140,49 +161,21 @@ public final class SNDefVisualPanel2 extends JPanel {
                 delButtonActionPerformed(evt);
                 delButtonActionPerformed(evt);
             }
             }
         });
         });
-
-        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
-        jPanel1.setLayout(jPanel1Layout);
-        jPanel1Layout.setHorizontalGroup(
-            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(jPanel1Layout.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE)
-                    .addGroup(jPanel1Layout.createSequentialGroup()
-                        .addComponent(titleLabel)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                        .addComponent(addButton)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(delButton)))
-                .addContainerGap())
-        );
-        jPanel1Layout.setVerticalGroup(
-            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
-                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(jPanel1Layout.createSequentialGroup()
-                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                        .addComponent(titleLabel))
-                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
-                        .addComponent(delButton)
-                        .addGap(0, 0, Short.MAX_VALUE))
-                    .addGroup(jPanel1Layout.createSequentialGroup()
-                        .addGap(0, 0, Short.MAX_VALUE)
-                        .addComponent(addButton)))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE))
-        );
+        jToolBar1.add(delButton);
 
 
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
         this.setLayout(layout);
         layout.setHorizontalGroup(
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
         );
         );
         layout.setVerticalGroup(
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addGroup(layout.createSequentialGroup()
+                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE))
         );
         );
     }// </editor-fold>//GEN-END:initComponents
     }// </editor-fold>//GEN-END:initComponents
 
 
@@ -204,6 +197,7 @@ public final class SNDefVisualPanel2 extends JPanel {
     private javax.swing.JButton delButton;
     private javax.swing.JButton delButton;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JScrollPane jScrollPane1;
     private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JToolBar jToolBar1;
     private javax.swing.JLabel titleLabel;
     private javax.swing.JLabel titleLabel;
     private javax.swing.JTable varTable;
     private javax.swing.JTable varTable;
     // End of variables declaration//GEN-END:variables
     // End of variables declaration//GEN-END:variables

+ 18 - 20
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefWizardIterator.java

@@ -32,8 +32,8 @@ import org.openide.util.NbBundle.Messages;
 
 
 // TODO define position attribute
 // TODO define position attribute
 @TemplateRegistrations({
 @TemplateRegistrations({
-@TemplateRegistration(folder = "Material", content = "../SNDefTemplate.j3sn", displayName = "#SNDefWizardIterator_displayName", iconBase = "com/jme3/gde/materialdefinition/icons/node.png", description = "../sNDef.html", scriptEngine = "freemarker"),
-@TemplateRegistration(folder = "Material", content = "../ShaderNodeSource", scriptEngine = "freemarker")
+    @TemplateRegistration(folder = "Material", content = "../SNDefTemplate.j3sn", displayName = "Shader Node Definition", iconBase = "com/jme3/gde/materialdefinition/icons/node.png", description = "./sNDef.html", scriptEngine = "freemarker"),
+    @TemplateRegistration(folder = "Material", content = "../ShaderNodeSource", scriptEngine = "freemarker")
 })
 })
 @Messages("SNDefWizardIterator_displayName=Shader Node Definition")
 @Messages("SNDefWizardIterator_displayName=Shader Node Definition")
 @SuppressWarnings({"unchecked", "rawtypes"})
 @SuppressWarnings({"unchecked", "rawtypes"})
@@ -103,38 +103,36 @@ public final class SNDefWizardIterator implements WizardDescriptor.Instantiating
         //Get the template and convert it:
         //Get the template and convert it:
         FileObject tplSnd = Templates.getTemplate(wizard);
         FileObject tplSnd = Templates.getTemplate(wizard);
         FileObject tplShd = tplSnd.getParent().getChildren()[1];
         FileObject tplShd = tplSnd.getParent().getChildren()[1];
-        
+
         DataObject templateSnd = DataObject.find(tplSnd);
         DataObject templateSnd = DataObject.find(tplSnd);
         DataObject templateShd = DataObject.find(tplShd);
         DataObject templateShd = DataObject.find(tplShd);
 
 
-        
-        
         //Get the package:
         //Get the package:
         FileObject dir = Templates.getTargetFolder(wizard);
         FileObject dir = Templates.getTargetFolder(wizard);
         DataFolder df = DataFolder.findFolder(dir);
         DataFolder df = DataFolder.findFolder(dir);
 
 
-        ProjectAssetManager assetManager = new ProjectAssetManager(Templates.getProject(wizard),"assets");
-        
+        ProjectAssetManager assetManager = new ProjectAssetManager(Templates.getProject(wizard), "assets");
+
         //Get the class:
         //Get the class:
         String targetName = Templates.getTargetName(wizard);
         String targetName = Templates.getTargetName(wizard);
         String shaderName = targetName;
         String shaderName = targetName;
-        if (panel1.getDefType().equals("Fragment")) {
-            shaderName += ".frag";
-        } else if (panel1.getDefType().equals("Vertex")) {
-            shaderName += ".vert";
-        } else {
-            shaderName += ".frag";
+        String ext = ".frag";
+        if (panel1.getDefType().equals("Vertex")) {
+            ext = ".vert";
         }
         }
-        
-        args.put("shaderSnippet",assetManager.getRelativeAssetPath(dir.getPath()+"/"+shaderName));
+        args.put("ext", ext);
+        args.put("glslVersions", panel1.getGlslVersions());
+
+        args.put("shaderSnippet", assetManager.getRelativeAssetPath(dir.getPath() + "/" + shaderName));
 
 
         //Define the template from the above,
         //Define the template from the above,
         //passing the package, the file name, and the map of strings to the template:
         //passing the package, the file name, and the map of strings to the template:
-       // DataObject dobj = templateSnd.createFromTemplate(df, targetName, args);
-        
-       
-        DataObject sobj = templateShd.createFromTemplate(df, shaderName, args);
- DataObject dobj = templateSnd.createFromTemplate(df, targetName, args);
+        // DataObject dobj = templateSnd.createFromTemplate(df, targetName, args);
+        for (String ver : panel1.getGlslVersions()) {
+            templateShd.createFromTemplate(df, shaderName + ver + ext, args);
+        }
+
+        DataObject dobj = templateSnd.createFromTemplate(df, targetName, args);
         //Obtain a FileObject:
         //Obtain a FileObject:
         createdFile = dobj.getPrimaryFile();
         createdFile = dobj.getPrimaryFile();
 
 

+ 2 - 5
jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/sNDef.html

@@ -7,10 +7,7 @@ and open the template in the editor.
     <head>
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     </head>
-    <body>
-        <!--
-        TODO replace this with a description what your wizard is supposed to do.
-        This information will be displayed in the New Wizard Description area.
-        -->
+    <body>        
+        A new Shader Node Definition file that can be instantiated as a Shader Node in the Shader Node editor
     </body>
     </body>
 </html>
 </html>