- improve SceneRequest Node handling

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10110 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 1c2baedbc1
commit 220490bee7
  1. 33
      sdk/jme3-core/src/com/jme3/gde/core/scene/SceneRequest.java

@ -35,6 +35,7 @@ import com.jme3.gde.core.assets.ProjectAssetManager;
import com.jme3.gde.core.sceneexplorer.nodes.JmeNode; import com.jme3.gde.core.sceneexplorer.nodes.JmeNode;
import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility;
import org.openide.loaders.DataObject; import org.openide.loaders.DataObject;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx; import org.openide.util.HelpCtx;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.openide.util.lookup.Lookups; import org.openide.util.lookup.Lookups;
@ -53,9 +54,15 @@ public class SceneRequest {
private ProjectAssetManager manager; private ProjectAssetManager manager;
private boolean displayed = false; private boolean displayed = false;
private DataObject dataObject; private DataObject dataObject;
private Node dataNode;
private HelpCtx helpCtx; private HelpCtx helpCtx;
private FakeApplication fakeApp; private FakeApplication fakeApp;
public SceneRequest(Object requester, ProjectAssetManager manager) {
this.requester = requester;
this.manager = manager;
}
public SceneRequest(Object requester, JmeNode rootNode, ProjectAssetManager manager) { public SceneRequest(Object requester, JmeNode rootNode, ProjectAssetManager manager) {
this.requester = requester; this.requester = requester;
this.jmeNode = rootNode; this.jmeNode = rootNode;
@ -112,6 +119,10 @@ public class SceneRequest {
return jmeNode; return jmeNode;
} }
public void setJmeNode(JmeNode jmeNode) {
this.jmeNode = jmeNode;
}
public com.jme3.scene.Spatial getRootNode() { public com.jme3.scene.Spatial getRootNode() {
return rootNode; return rootNode;
} }
@ -145,8 +156,9 @@ public class SceneRequest {
} }
/** /**
* Add an additional Node that is not displayed in the SceneExplorer and can be * Add an additional Node that is not displayed in the SceneExplorer and can
* used for displaying in-world tools, templates, previews etc. * be used for displaying in-world tools, templates, previews etc.
*
* @param toolScene the toolScene to set * @param toolScene the toolScene to set
*/ */
public void setToolNode(com.jme3.scene.Node toolNode) { public void setToolNode(com.jme3.scene.Node toolNode) {
@ -159,18 +171,34 @@ public class SceneRequest {
/** /**
* sets the DataObject associated with this scene * sets the DataObject associated with this scene
*
* @param dataObject * @param dataObject
*/ */
public void setDataObject(DataObject dataObject) { public void setDataObject(DataObject dataObject) {
this.dataObject = dataObject; this.dataObject = dataObject;
} }
public Node getDataNode() {
if (dataNode != null) {
return dataNode;
}
if (getDataObject() != null) {
return getDataObject().getNodeDelegate();
}
return dataNode;
}
public void setDataNode(Node dataNode) {
this.dataNode = dataNode;
}
public HelpCtx getHelpCtx() { public HelpCtx getHelpCtx() {
return helpCtx; return helpCtx;
} }
/** /**
* Set the help context for the SceneViewer window * Set the help context for the SceneViewer window
*
* @param helpCtx * @param helpCtx
*/ */
public void setHelpCtx(HelpCtx helpCtx) { public void setHelpCtx(HelpCtx helpCtx) {
@ -184,5 +212,4 @@ public class SceneRequest {
public FakeApplication getFakeApp() { public FakeApplication getFakeApp() {
return fakeApp; return fakeApp;
} }
} }

Loading…
Cancel
Save