SDK:
- fix Filter Explorer not updating its properties git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10973 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
a7f0a5a99b
commit
5a89b07fc4
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user