- Renaming a Spatial Node in the scene explorer now properly lights up the save button

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9650 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 13 years ago
parent 116ced422b
commit ba2e17ef89
  1. 2
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeAssetLinkNode.java
  2. 2
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeAudioNode.java
  3. 2
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeBitmapText.java
  4. 3
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeGeometry.java
  5. 7
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeSpatial.java
  6. 2
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeTerrainGrid.java
  7. 2
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeTerrainQuad.java

@ -79,7 +79,7 @@ public class JmeAssetLinkNode extends JmeNode {
linkChildren = (AssetLinkChildren)getChildren(); linkChildren = (AssetLinkChildren)getChildren();
linkChildren.setReadOnly(children.readOnly); linkChildren.setReadOnly(children.readOnly);
this.geom = spatial; this.geom = spatial;
setName(spatial.getName()); // setName(spatial.getName());
} }
@Override @Override

@ -60,7 +60,7 @@ public class JmeAudioNode extends JmeNode {
super(spatial, children); super(spatial, children);
getLookupContents().add(spatial); getLookupContents().add(spatial);
this.node = spatial; this.node = spatial;
setName(spatial.getName()); // setName(spatial.getName());
} }
@Override @Override

@ -58,7 +58,7 @@ public class JmeBitmapText extends JmeNode {
super(spatial, children); super(spatial, children);
getLookupContents().add(spatial); getLookupContents().add(spatial);
this.geom = spatial; this.geom = spatial;
setName(spatial.getName()); // setName(spatial.getName());
} }
@Override @Override

@ -33,7 +33,6 @@ package com.jme3.gde.core.sceneexplorer.nodes;
import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.core.scene.SceneApplication;
import com.jme3.gde.core.sceneexplorer.SceneExplorerTopComponent; import com.jme3.gde.core.sceneexplorer.SceneExplorerTopComponent;
import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode;
import com.jme3.gde.core.sceneexplorer.MaterialChangeListener; import com.jme3.gde.core.sceneexplorer.MaterialChangeListener;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
@ -42,6 +41,7 @@ import java.awt.Image;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import org.openide.loaders.DataObject; import org.openide.loaders.DataObject;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.Sheet; import org.openide.nodes.Sheet;
import org.openide.util.ImageUtilities; import org.openide.util.ImageUtilities;
@ -75,7 +75,6 @@ public class JmeGeometry extends JmeSpatial implements MaterialChangeListener {
} }
}); });
setName(spatial.getName());
} }
@Override @Override

@ -165,11 +165,16 @@ public class JmeSpatial extends AbstractSceneExplorerNode {
return !((JmeSpatialChildren) jmeChildren).readOnly; return !((JmeSpatialChildren) jmeChildren).readOnly;
} }
/**
* Warning this methods also changes the name of the spatial in the scene
* it will mark the file as changed and will activate save button.
* @param s
*/
@Override @Override
public void setName(final String s) { public void setName(final String s) {
super.setName(s); super.setName(s);
try { try {
// fireSave(true); fireSave(true);
SceneApplication.getApplication().enqueue(new Callable<Void>() { SceneApplication.getApplication().enqueue(new Callable<Void>() {
public Void call() throws Exception { public Void call() throws Exception {

@ -62,7 +62,7 @@ public class JmeTerrainGrid extends JmeTerrainQuad implements TerrainGridListene
super(spatial, children); super(spatial, children);
getLookupContents().add(spatial); getLookupContents().add(spatial);
this.geom = spatial; this.geom = spatial;
setName(spatial.getName()); // setName(spatial.getName());
geom.addListener(this); geom.addListener(this);
} }

@ -56,7 +56,7 @@ public class JmeTerrainQuad extends JmeNode {
super(spatial, children); super(spatial, children);
getLookupContents().add(spatial); getLookupContents().add(spatial);
this.geom = spatial; this.geom = spatial;
setName(spatial.getName()); // setName(spatial.getName());
} }
@Override @Override

Loading…
Cancel
Save