diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/AbstractFilterNode.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/AbstractFilterNode.java
index b5890f4bb..956068f26 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/filters/AbstractFilterNode.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/AbstractFilterNode.java
@@ -223,6 +223,9 @@ public abstract class AbstractFilterNode extends AbstractNode implements FilterN
if (name.equals("Enabled")) {
toggleIcon((Boolean) after);
}
+ if (name.equals("Name")) {
+ setName((String)after);
+ }
fireSave(true);
firePropertyChange(name, before, after);
}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java
index 956ae157b..83bd965b1 100644
--- a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/NewBloomFilterAction.java
@@ -1,54 +1,122 @@
/*
- * Copyright (c) 2009-2010 jMonkeyEngine
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * Copyright (c) 2009-2010 jMonkeyEngine All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.jme3.gde.core.filters.impl;
-import com.jme3.gde.core.filters.actions.AbstractNewFilterAction;
+import com.jme3.gde.core.filters.actions.AbstractNewFilterWizardAction;
import com.jme3.gde.core.filters.actions.NewFilterAction;
+import com.jme3.gde.core.filters.impl.bloom.BloomWizardPanel1;
import com.jme3.post.Filter;
+import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.BloomFilter;
+import java.awt.Component;
+import java.awt.Dialog;
+import java.text.MessageFormat;
+import javax.swing.JComponent;
+import org.openide.DialogDisplayer;
+import org.openide.WizardDescriptor;
+import org.openide.nodes.Node;
/**
*
* @author normenhansen
*/
@org.openide.util.lookup.ServiceProvider(service = NewFilterAction.class)
-public class NewBloomFilterAction extends AbstractNewFilterAction {
+public class NewBloomFilterAction extends AbstractNewFilterWizardAction {
+
+ private WizardDescriptor.Panel[] panels;
public NewBloomFilterAction() {
name = "Bloom";
}
@Override
- protected Filter doCreateFilter() {
- return new BloomFilter();
+ protected Object showWizard(Node node) {
+ WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
+ // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
+ wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
+ wizardDescriptor.setTitle("Your wizard dialog title here");
+ Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
+ dialog.setVisible(true);
+ dialog.toFront();
+ boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
+ if (!cancelled) {
+ return wizardDescriptor;
+ }
+ return null;
+ }
+
+ @Override
+ protected Filter doCreateFilter(FilterPostProcessor parent, Object configuration) {
+ if (configuration != null) {
+ WizardDescriptor wiz = (WizardDescriptor) configuration;
+ if (wiz.getProperty("mode").equals("Scene")) {
+ return new BloomFilter(BloomFilter.GlowMode.Scene);
+ } else {
+ return new BloomFilter(BloomFilter.GlowMode.Objects);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Initialize panels representing individual wizard's steps and sets
+ * various properties for them influencing wizard appearance.
+ */
+ private WizardDescriptor.Panel[] getPanels() {
+ if (panels == null) {
+ panels = new WizardDescriptor.Panel[]{
+ new BloomWizardPanel1()
+ };
+ String[] steps = new String[panels.length];
+ for (int i = 0; i < panels.length; i++) {
+ Component c = panels[i].getComponent();
+ // Default step name to component name of panel. Mainly useful
+ // for getting the name of the target chooser to appear in the
+ // list of steps.
+ steps[i] = c.getName();
+ if (c instanceof JComponent) { // assume Swing components
+ JComponent jc = (JComponent) c;
+ // Sets step number of a component
+ // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
+ jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+ // Sets steps names for a panel
+ jc.putClientProperty("WizardPanel_contentData", steps);
+ // Turn on subtitle creation on each step
+ jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE);
+ // Show steps on the left side with the image on the background
+ jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE);
+ // Turn on numbering of all steps
+ jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE);
+ }
+ }
+ }
+ return panels;
}
}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomVisualPanel1.form b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomVisualPanel1.form
new file mode 100644
index 000000000..62a662e7f
--- /dev/null
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomVisualPanel1.form
@@ -0,0 +1,118 @@
+
+
+
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomVisualPanel1.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomVisualPanel1.java
new file mode 100644
index 000000000..3e158b0bb
--- /dev/null
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomVisualPanel1.java
@@ -0,0 +1,114 @@
+
+package com.jme3.gde.core.filters.impl.bloom;
+
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+
+public final class BloomVisualPanel1 extends JPanel {
+
+ /**
+ * Creates new form BloomVisualPanel1
+ */
+ public BloomVisualPanel1() {
+ initComponents();
+ }
+
+ @Override
+ public String getName() {
+ return "Bloom setting...";
+ }
+
+ public JComboBox getBloomModeCombo() {
+ return jComboBox1;
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jFrame1 = new javax.swing.JFrame();
+ buttonGroup1 = new javax.swing.ButtonGroup();
+ buttonGroup2 = new javax.swing.ButtonGroup();
+ jLabel1 = new javax.swing.JLabel();
+ jComboBox1 = new javax.swing.JComboBox();
+ jLabel2 = new javax.swing.JLabel();
+ jLabel3 = new javax.swing.JLabel();
+
+ javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
+ jFrame1.getContentPane().setLayout(jFrame1Layout);
+ jFrame1Layout.setHorizontalGroup(
+ jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 400, Short.MAX_VALUE)
+ );
+ jFrame1Layout.setVerticalGroup(
+ jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 300, Short.MAX_VALUE)
+ );
+
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(BloomVisualPanel1.class, "BloomVisualPanel1.jLabel1.text")); // NOI18N
+
+ jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Scene", "Objects" }));
+ jComboBox1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jComboBox1ActionPerformed(evt);
+ }
+ });
+
+ jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(BloomVisualPanel1.class, "BloomVisualPanel1.jLabel2.text")); // NOI18N
+
+ org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(BloomVisualPanel1.class, "BloomVisualPanel1.jLabel3.text")); // NOI18N
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(107, 107, 107)
+ .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel2)))
+ .addContainerGap(316, Short.MAX_VALUE))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel3)
+ .addComponent(jLabel1))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(6, 6, 6)
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(jLabel3)
+ .addContainerGap(113, Short.MAX_VALUE))
+ );
+ }// //GEN-END:initComponents
+
+private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
+// TODO add your handling code here:
+}//GEN-LAST:event_jComboBox1ActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.ButtonGroup buttonGroup1;
+ private javax.swing.ButtonGroup buttonGroup2;
+ private javax.swing.JComboBox jComboBox1;
+ private javax.swing.JFrame jFrame1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java
new file mode 100644
index 000000000..5895686c4
--- /dev/null
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardAction.java
@@ -0,0 +1,71 @@
+
+package com.jme3.gde.core.filters.impl.bloom;
+
+import java.awt.Component;
+import java.awt.Dialog;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.MessageFormat;
+import javax.swing.JComponent;
+import org.openide.DialogDisplayer;
+import org.openide.WizardDescriptor;
+
+// An example action demonstrating how the wizard could be called from within
+// your code. You can move the code below wherever you need, or register an action:
+// @ActionID(category="...", id="com.jme3.gde.core.filters.impl.bloom.BloomWizardAction")
+// @ActionRegistration(displayName="Open Bloom Wizard")
+// @ActionReference(path="Menu/Tools", position=...)
+public final class BloomWizardAction implements ActionListener {
+
+ private WizardDescriptor.Panel[] panels;
+
+ public @Override
+ void actionPerformed(ActionEvent e) {
+ WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
+ // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
+ wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
+ wizardDescriptor.setTitle("Your wizard dialog title here");
+ Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
+ dialog.setVisible(true);
+ dialog.toFront();
+ boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
+ if (!cancelled) {
+ // do something
+ }
+ }
+
+ /**
+ * Initialize panels representing individual wizard's steps and sets
+ * various properties for them influencing wizard appearance.
+ */
+ private WizardDescriptor.Panel[] getPanels() {
+ if (panels == null) {
+ panels = new WizardDescriptor.Panel[]{
+ new BloomWizardPanel1()
+ };
+ String[] steps = new String[panels.length];
+ for (int i = 0; i < panels.length; i++) {
+ Component c = panels[i].getComponent();
+ // Default step name to component name of panel. Mainly useful
+ // for getting the name of the target chooser to appear in the
+ // list of steps.
+ steps[i] = c.getName();
+ if (c instanceof JComponent) { // assume Swing components
+ JComponent jc = (JComponent) c;
+ // Sets step number of a component
+ // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
+ jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
+ // Sets steps names for a panel
+ jc.putClientProperty("WizardPanel_contentData", steps);
+ // Turn on subtitle creation on each step
+ jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE);
+ // Show steps on the left side with the image on the background
+ jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE);
+ // Turn on numbering of all steps
+ jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE);
+ }
+ }
+ }
+ return panels;
+ }
+}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardPanel1.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardPanel1.java
new file mode 100644
index 000000000..4b189f54e
--- /dev/null
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/BloomWizardPanel1.java
@@ -0,0 +1,87 @@
+
+package com.jme3.gde.core.filters.impl.bloom;
+
+import java.awt.Component;
+import javax.swing.event.ChangeListener;
+import org.openide.WizardDescriptor;
+import org.openide.util.HelpCtx;
+
+public class BloomWizardPanel1 implements WizardDescriptor.Panel {
+
+ /**
+ * The visual component that displays this panel. If you need to access the
+ * component from this class, just use getComponent().
+ */
+ private Component component;
+
+ // Get the visual component for the panel. In this template, the component
+ // is kept separate. This can be more efficient: if the wizard is created
+ // but never displayed, or not all panels are displayed, it is better to
+ // create only those which really need to be visible.
+ public Component getComponent() {
+ if (component == null) {
+ component = new BloomVisualPanel1();
+ }
+ return component;
+ }
+
+ public HelpCtx getHelp() {
+ // Show no Help button for this panel:
+ return HelpCtx.DEFAULT_HELP;
+ // If you have context help:
+ // return new HelpCtx(SampleWizardPanel1.class);
+ }
+
+ public boolean isValid() {
+ // If it is always OK to press Next or Finish, then:
+ return true;
+ // If it depends on some condition (form filled out...), then:
+ // return someCondition();
+ // and when this condition changes (last form field filled in...) then:
+ // fireChangeEvent();
+ // and uncomment the complicated stuff below.
+ }
+
+ public final void addChangeListener(ChangeListener l) {
+ }
+
+ public final void removeChangeListener(ChangeListener l) {
+ }
+ /*
+ private final Set listeners = new HashSet(1); // or can use ChangeSupport in NB 6.0
+ public final void addChangeListener(ChangeListener l) {
+ synchronized (listeners) {
+ listeners.add(l);
+ }
+ }
+ public final void removeChangeListener(ChangeListener l) {
+ synchronized (listeners) {
+ listeners.remove(l);
+ }
+ }
+ protected final void fireChangeEvent() {
+ Iterator it;
+ synchronized (listeners) {
+ it = new HashSet(listeners).iterator();
+ }
+ ChangeEvent ev = new ChangeEvent(this);
+ while (it.hasNext()) {
+ it.next().stateChanged(ev);
+ }
+ }
+ */
+
+ // You can use a settings object to keep track of state. Normally the
+ // settings object will be the WizardDescriptor, so you can use
+ // WizardDescriptor.getProperty & putProperty to store information entered
+ // by the user.
+ public void readSettings(Object settings) {
+ }
+
+ public void storeSettings(Object settings) {
+ WizardDescriptor wiz = (WizardDescriptor) settings;
+ BloomVisualPanel1 comp = (BloomVisualPanel1) getComponent();
+ String mode=comp.getBloomModeCombo().getSelectedItem().toString();
+ wiz.putProperty("mode", mode );
+ }
+}
diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/Bundle.properties b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/Bundle.properties
new file mode 100644
index 000000000..62fa9830f
--- /dev/null
+++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/impl/bloom/Bundle.properties
@@ -0,0 +1,4 @@
+Error reading included file Templates/Other/../Licenses/license-jme.txt
+BloomVisualPanel1.jLabel1.text=Scene : extract bright areas of the rendered scene and make them glow
+BloomVisualPanel1.jLabel2.text=Bloom mode
+BloomVisualPanel1.jLabel3.text=Objects : use Glow_Map or Glow_Color of scene's geometries' material to use for the glow source