本文整理匯總了Java中com.jme3.gde.core.scene.SceneRequest類的典型用法代碼示例。如果您正苦於以下問題:Java SceneRequest類的具體用法?Java SceneRequest怎麽用?Java SceneRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SceneRequest類屬於com.jme3.gde.core.scene包,在下文中一共展示了SceneRequest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sceneClosed
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void sceneClosed(SceneRequest request) {
if (request == currentRequest) {
SceneApplication.getApplication().removeSceneListener(this);
final SceneRequest current = currentRequest;
currentRequest = null;
final VehicleEditorController controller = editorController;
setLoadedScene(null, false);
cameraController.disable();
cameraController = null;
SceneApplication.getApplication().enqueue(new Callable<Void>() {
public Void call() throws Exception {
controller.cleanupApplication();
current.getRootNode().getParent().removeLight(dirLight);
return null;
}
});
}
}
示例2: sceneOpened
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void sceneOpened(final SceneRequest request) {
if (request == sentRequest) {
currentRequest = request;
editorController = newEditorController;
cameraController = new VehicleCreatorCameraController(SceneApplication.getApplication().getCamera(), SceneApplication.getApplication().getInputManager());
cameraController.setMaster(this);
cameraController.enable();
cameraController.setVehicle(request.getRootNode());
setLoadedScene(currentRequest.getDataObject().getNodeDelegate(), true);
final VehicleEditorController controller = editorController;
SceneApplication.getApplication().enqueue(new Callable<Void>() {
public Void call() throws Exception {
controller.prepareApplication();
request.getRootNode().getParent().addLight(dirLight);
return null;
}
});
}
}
示例3: actionPerformed
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void actionPerformed(ActionEvent ev) {
ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
if (pm == null) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
return;
}
Element assetElement = context.getLookup().lookup(Element.class);
com.jme3.scene.Node node = new com.jme3.scene.Node("PreviewRootNode");
Spatial model = null;
model = AssetPackLoader.loadAssetPackModel(pm, new AssetConfiguration(assetElement));
node.attachChild(model);
JmeNode jmeNode = NodeUtility.createNode(node);
SceneApplication app = SceneApplication.getApplication();
SceneRequest request = new SceneRequest(app, jmeNode, pm);
try {
request.setDataObject(DataObject.find(context.getLookup().lookup(Project.class).getProjectDirectory()));
} catch (DataObjectNotFoundException ex) {
Exceptions.printStackTrace(ex);
}
request.setWindowTitle("AssetPack - PreView Model");
app.openScene(request);
}
示例4: openScene
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void openScene(Spatial spat, AssetDataObject file, ProjectAssetManager manager) {
cleanupControllers();
SceneApplication.getApplication().addSceneListener(this);
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, file, false);
SceneRequest request = new SceneRequest(this, jmeNode, manager);
request.setDataObject(file);
request.setHelpCtx(ctx);
this.sentRequest = request;
request.setWindowTitle("SceneComposer - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
request.setToolNode(new Node("SceneComposerToolNode"));
SceneApplication.getApplication().openScene(request);
}
示例5: AppStateExplorerTopComponent
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public AppStateExplorerTopComponent() {
initComponents();
setName(Bundle.CTL_AppStateExplorerTopComponent());
setToolTipText(Bundle.HINT_AppStateExplorerTopComponent());
ActionMap map = getActionMap();
map.put("delete", ExplorerUtils.actionDelete(explorerManager, true));
// map.put("moveup", new MoveUpAction());
// map.put("movedown", new MoveDownAction());
associateLookup(ExplorerUtils.createLookup(explorerManager, map));
//TODO: move to scene listener notify in scene?
SceneRequest request = SceneApplication.getApplication().getCurrentSceneRequest();
if (request != null) {
listener.sceneOpened(request);
}
SceneApplication.getApplication().addSceneListener(listener);
}
示例6: sceneOpened
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
@Override
public void sceneOpened(SceneRequest request) {
final JmeNode node = request.getJmeNode();
for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) {
MaterialChangeProvider provider = (MaterialChangeProvider) it.next();
provider.clearMaterialChangeListeners();
}
if (node != null) {
explorerManager.setRootContext(node);
explorerManager.getRootContext().setDisplayName(node.getName());
setActivatedNodes(new Node[]{node});
requestVisible();
try {
explorerManager.setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException ex) {
Exceptions.printStackTrace(ex);
}
setTerrainLodCamera(node);
}
}
示例7: initSceneViewerWithSpatial
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
/**
* Creates a new {@link SceneRequest} and launches the OGL Window loaded
* with {@link Spatial} spat and {@link CinematicEditorTopComponent}
*
* @param spat
* @param layer
* @throws DataObjectNotFoundException
*/
private void initSceneViewerWithSpatial(Spatial spat,SpatialLayer layer) throws DataObjectNotFoundException {
AssetDataObject dataObject = getSpatialAssetDataObject(layer);
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, dataObject, false);
//assert jmeNode!=null:"see CinematicEditorManager#initSceneViewerWithSpatial";
SceneRequest request = new SceneRequest(this, jmeNode, assetManager);
request.setDataObject(dataObject);
// request.setHelpCtx(ctx);
this.sentRequest = request;
request.setWindowTitle("Cinematic Editor - " + currentDataObject.getName());
request.setToolNode(new Node("CinematicEditorToolNode"));
SceneApplication.getApplication().openScene(request);
}
示例8: actionPerformed
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void actionPerformed(ActionEvent ev) {
ProjectAssetManager pm = context.getLookup().lookup(ProjectAssetManager.class);
if (pm == null) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "AssetManager not found!");
return;
}
Element assetElement = context.getLookup().lookup(Element.class);
com.jme3.scene.Node node = new com.jme3.scene.Node("PreviewRootNode");
Spatial model = null;
model = AssetPackLoader.loadAssetPackModel(pm, new AssetConfiguration(assetElement));
node.attachChild(model);
JmeNode jmeNode = NodeUtility.createNode(node);
SceneApplication app = SceneApplication.getApplication();
SceneRequest request = new SceneRequest(app, jmeNode, pm);
try {
request.setDataObject(DataObject.find(context.getLookup().lookup(Project.class).getProjectDirectory()));
} catch (DataObjectNotFoundException ex) {
Exceptions.printStackTrace(ex);
}
request.setWindowTitle("AssetPack - PreView Model");
app.requestScene(request);
}
示例9: getTags
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public String[] getTags() {
SceneRequest request = SceneApplication.getApplication().getCurrentSceneRequest();
if (request == null) {
return new String[]{};
}
if (material.getAssetName() == null) {
String[] materials = request.getManager().getMaterials();
String[] mats = new String[materials.length + 1];
mats[0] = ("create j3m file");
for (int i = 0; i < materials.length; i++) {
String string = materials[i];
mats[i + 1] = string;
}
return mats;
} else {
return request.getManager().getMaterials();
}
}
示例10: openScene
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void openScene(Spatial spat, AssetDataObject file, ProjectAssetManager manager) {
cleanupControllers();
SceneApplication.getApplication().addSceneListener(this);
result.addLookupListener(this);
//TODO: handle request change
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, file, false);
SceneRequest request = new SceneRequest(this, jmeNode, manager);
request.setDataObject(file);
request.setHelpCtx(ctx);
// file.setSaveCookie(saveCookie);
if (editorController != null) {
editorController.cleanup();
}
editorController = new SceneEditorController(jmeNode, file);
this.currentRequest = request;
request.setWindowTitle("SceneComposer - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
request.setToolNode(new Node("SceneComposerToolNode"));
SceneApplication.getApplication().requestScene(request);
}
示例11: sceneClose
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public boolean sceneClose(SceneRequest request) {
if (request.equals(currentRequest)) {
// if (checkSaved()) {
SceneApplication.getApplication().removeSceneListener(this);
currentRequest = null;
setSceneInfo(null, null, false);
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
cleanupControllers();
}
});
// } else {
// return false;
// }
}
return true;
}
示例12: sceneClose
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public boolean sceneClose(SceneRequest request) {
if (request.equals(currentRequest)) {
// if (checkSaved()) {
SceneApplication.getApplication().removeSceneListener(this);
setSceneInfo(null, false);
currentRequest = null;
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
cleanupControllers();
}
});
// }
}
return true;
}
示例13: sceneRequested
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void sceneRequested(SceneRequest request) {
this.request = request;
final JmeNode node = request.getJmeNode();
for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) {
MaterialChangeProvider provider = (MaterialChangeProvider) it.next();
provider.clearMaterialChangeListeners();
}
if (node != null) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
explorerManager.setRootContext(node);
explorerManager.getRootContext().setDisplayName(node.getName());
requestVisible();
}
});
}
setTerrainLodCamera(node);
}
示例14: openFile
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void openFile(BinaryModelDataObject file, Node spatial) {
JmeNode node = NodeUtility.createNode(spatial, false);
newEditorController = new VehicleEditorController(node, file);
SceneApplication.getApplication().addSceneListener(this);
sentRequest = new SceneRequest(this, node, file.getLookup().lookup(ProjectAssetManager.class));
sentRequest.setWindowTitle("Vehicle Creator");
sentRequest.setDataObject(file);
sentRequest.setToolNode(newEditorController.getToolsNode());
sentRequest.setHelpCtx(ctx);
SceneApplication.getApplication().openScene(sentRequest);
}
示例15: openScene
import com.jme3.gde.core.scene.SceneRequest; //導入依賴的package包/類
public void openScene(Spatial spat, AssetDataObject file, ProjectAssetManager manager) {
cleanupControllers();
SceneApplication.getApplication().addSceneListener(this);
result.addLookupListener(this);
//TODO: handle request change
Node node;
if (spat instanceof Node) {
node = (Node) spat;
} else {
node = new Node();
node.attachChild(spat);
}
JmeNode jmeNode = NodeUtility.createNode(node, file, false);
SceneRequest request = new SceneRequest(this, jmeNode, manager);
request.setDataObject(file);
addSaveNode(jmeNode);
Logger.getLogger(NavMeshTopComponent.class.getName()).finer("NavMesh openScene " + file.getName());
if (editorController != null) {
editorController.cleanup();
}
editorController = new NavMeshController(jmeNode, file, this);
this.currentRequest = request;
request.setWindowTitle("NavMesh - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
request.setToolNode(new Node("NavMeshEditorToolNode"));
SceneApplication.getApplication().openScene(request);
}