From 5a89b07fc48cc05f0ebf9ba984ce03fd031b4e45 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Wed, 8 Jan 2014 12:58:23 +0000 Subject: [PATCH] SDK: - fix Filter Explorer not updating its properties git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10973 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../gde/core/filters/AbstractFilterNode.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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 35400bb61..a3887e62f 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 @@ -35,6 +35,7 @@ import com.jme3.gde.core.filters.actions.EnableFiterAction; import com.jme3.gde.core.icons.IconList; import com.jme3.gde.core.properties.SceneExplorerProperty; import com.jme3.gde.core.properties.ScenePropertyChangeListener; +import com.jme3.gde.core.scene.SceneSyncListener; import com.jme3.gde.core.util.PropertyUtils; import com.jme3.post.Filter; import java.awt.Image; @@ -59,7 +60,7 @@ import org.openide.util.actions.SystemAction; * @author normenhansen */ @SuppressWarnings("unchecked") -public abstract class AbstractFilterNode extends AbstractNode implements FilterNode, ScenePropertyChangeListener { +public abstract class AbstractFilterNode extends AbstractNode implements FilterNode, ScenePropertyChangeListener, SceneSyncListener { protected boolean readOnly = false; protected DataObject dataObject; @@ -112,6 +113,18 @@ public abstract class AbstractFilterNode extends AbstractNode implements FilterN }; } + public void syncSceneData(float tpf) { + //TODO: precache structure to avoid locks? Do it backwards, sending the actual bean value? + for (PropertySet propertySet : getPropertySets()) { + for (Property property : propertySet.getProperties()) { + if(property instanceof SceneExplorerProperty){ + SceneExplorerProperty prop = (SceneExplorerProperty)property; + prop.syncValue(); + } + } + } + } + @Override public Action getPreferredAction() { return Actions.alwaysEnabled(new EnableFiterAction(this), "Toggle enabled", "", false); @@ -222,7 +235,13 @@ public abstract class AbstractFilterNode extends AbstractNode implements FilterN if (name.equals("Name")) { setName((String)after); } - fireSave(true); + firePropertyChange(name, before, after); + if (!SceneExplorerProperty.PROP_INIT_CHANGE.equals(type)) { + fireSave(true); + } + } + + public void propertyChange(final String type, final String name, final Object before, final Object after) { firePropertyChange(name, before, after); }