Enhanced the ShaderNodeDefinition creation wizard

experimental
Nehon 10 years ago
parent c310b933c9
commit e14c30a3cf
  1. BIN
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/add.png
  2. BIN
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/remove.png
  3. 6
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/SNDefTemplate.j3sn
  4. 13
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/sNDef.html
  5. 13
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/Bundle.properties
  6. 114
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.form
  7. 125
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.java
  8. 78
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.form
  9. 70
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java
  10. 20
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefWizardIterator.java
  11. 5
      sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/sNDef.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

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

@ -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>

@ -3,8 +3,17 @@ SNDefVisualPanel1.defNameTextField.toolTipText=
SNDefVisualPanel1.defNameTextField.text=
SNDefVisualPanel1.jLabel2.text=Shader type
SNDefVisualPanel1.jPanel2.border.title=Description
SNDefVisualPanel2.addButton.text=
SNDefVisualPanel2.addButton.text=Add
SNDefVisualPanel2.titleLabel.text=Inputs
SNDefVisualPanel2.addButton.toolTipText=Add 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=

@ -31,14 +31,36 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel2" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" 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"/>
@ -50,6 +72,8 @@
</Group>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -57,7 +81,7 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="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">
<Component id="jLabel1" 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"/>
</Group>
<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"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -125,7 +161,7 @@
<Layout>
<DimensionLayout dim="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>
</DimensionLayout>
<DimensionLayout dim="1">
@ -152,6 +188,74 @@
</Container>
</SubComponents>
</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>
</Container>
</SubComponents>

@ -6,6 +6,8 @@
package com.jme3.gde.shadernodedefinition.wizard;
import com.jme3.shader.Shader;
import java.util.ArrayList;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
@ -20,8 +22,10 @@ public final class SNDefVisualPanel1 extends JPanel {
initComponents();
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
for (Shader.ShaderType shaderType : Shader.ShaderType.values()) {
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);
}
@ -42,6 +46,34 @@ public final class SNDefVisualPanel1 extends JPanel {
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.
@ -59,6 +91,15 @@ public final class SNDefVisualPanel1 extends JPanel {
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
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
@ -79,37 +120,83 @@ public final class SNDefVisualPanel1 extends JPanel {
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
.addComponent(jScrollPane1)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.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);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
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.createSequentialGroup()
.addContainerGap()
.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)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.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))))
.addComponent(shaderTypeCB, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.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(shaderTypeCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.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)
.addContainerGap())
);
@ -134,11 +232,28 @@ public final class SNDefVisualPanel1 extends JPanel {
);
}// </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
private javax.swing.JTextField customGlslVer;
private javax.swing.JTextField defNameTextField;
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 jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;

@ -16,56 +16,16 @@
<Layout>
<DimensionLayout dim="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>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<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>
<Component id="jToolBar1" min="-2" pref="25" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="278" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="455" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -94,6 +54,14 @@
</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.DesignBoxLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="titleLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@ -101,10 +69,28 @@
</Property>
</Properties>
</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">
<Properties>
<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 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;)"/>
@ -121,7 +107,7 @@
<Component class="javax.swing.JButton" name="delButton">
<Properties>
<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 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;)"/>

@ -93,10 +93,11 @@ public final class SNDefVisualPanel2 extends JPanel {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
varTable = new javax.swing.JTable();
jToolBar1 = new javax.swing.JToolBar();
titleLabel = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
addButton = new javax.swing.JButton();
delButton = new javax.swing.JButton();
@ -119,9 +120,28 @@ public final class SNDefVisualPanel2 extends JPanel {
});
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
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
addButton.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.addButton.toolTipText")); // NOI18N
addButton.setAlignmentX(0.5F);
@ -130,8 +150,9 @@ public final class SNDefVisualPanel2 extends JPanel {
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
delButton.setToolTipText(org.openide.util.NbBundle.getMessage(SNDefVisualPanel2.class, "SNDefVisualPanel2.delButton.toolTipText")); // NOI18N
delButton.setAlignmentX(0.5F);
@ -140,49 +161,21 @@ public final class SNDefVisualPanel2 extends JPanel {
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);
this.setLayout(layout);
layout.setHorizontalGroup(
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.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
@ -204,6 +197,7 @@ public final class SNDefVisualPanel2 extends JPanel {
private javax.swing.JButton delButton;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JToolBar jToolBar1;
private javax.swing.JLabel titleLabel;
private javax.swing.JTable varTable;
// End of variables declaration//GEN-END:variables

@ -32,7 +32,7 @@ import org.openide.util.NbBundle.Messages;
// TODO define position attribute
@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 = "../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")
@ -107,8 +107,6 @@ public final class SNDefWizardIterator implements WizardDescriptor.Instantiating
DataObject templateSnd = DataObject.find(tplSnd);
DataObject templateShd = DataObject.find(tplShd);
//Get the package:
FileObject dir = Templates.getTargetFolder(wizard);
DataFolder df = DataFolder.findFolder(dir);
@ -118,22 +116,22 @@ public final class SNDefWizardIterator implements WizardDescriptor.Instantiating
//Get the class:
String targetName = Templates.getTargetName(wizard);
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("ext", ext);
args.put("glslVersions", panel1.getGlslVersions());
args.put("shaderSnippet", assetManager.getRelativeAssetPath(dir.getPath() + "/" + shaderName));
//Define the template from the above,
//passing the package, the file name, and the map of strings to the template:
// DataObject dobj = templateSnd.createFromTemplate(df, targetName, args);
for (String ver : panel1.getGlslVersions()) {
templateShd.createFromTemplate(df, shaderName + ver + ext, args);
}
DataObject sobj = templateShd.createFromTemplate(df, shaderName, args);
DataObject dobj = templateSnd.createFromTemplate(df, targetName, args);
//Obtain a FileObject:
createdFile = dobj.getPrimaryFile();

@ -8,9 +8,6 @@ and open the template in the editor.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</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.
-->
A new Shader Node Definition file that can be instantiated as a Shader Node in the Shader Node editor
</body>
</html>

Loading…
Cancel
Save