当前位置: 首页>>代码示例>>Java>>正文


Java NodeUtility类代码示例

本文整理汇总了Java中com.jme3.gde.core.sceneexplorer.nodes.NodeUtility的典型用法代码示例。如果您正苦于以下问题:Java NodeUtility类的具体用法?Java NodeUtility怎么用?Java NodeUtility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NodeUtility类属于com.jme3.gde.core.sceneexplorer.nodes包,在下文中一共展示了NodeUtility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:24,代码来源:PreviewAssetAction.java

示例2: openScene

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:SceneComposerTopComponent.java

示例3: resultChanged

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的package包/类
/**
     * result listener for application start
     */
    public void resultChanged(LookupEvent ev) {
//        System.out.println("Select Thread: " + Thread.currentThread().getName());
        Collection collection = applicationResult.allInstances();
        for (Iterator it = collection.iterator(); it.hasNext();) {
            Object obj = it.next();
            if (obj instanceof SceneApplication) {
                SceneApplication app = (SceneApplication) obj;
                if (app != null) {
                    Node node = NodeUtility.createNode(((SceneApplication) app).getRootNode());
                    explorerManager.setRootContext(node);
                    explorerManager.getRootContext().setDisplayName(node.getName());
                    return;
                }
            }
        }
        explorerManager.setRootContext(Node.EMPTY);
    }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:21,代码来源:SceneNavigatorPanel.java

示例4: initSceneViewerWithSpatial

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);
    
    
}
 
开发者ID:maany,项目名称:jME-CinematicEditor,代码行数:33,代码来源:CinematicEditorManager.java

示例5: actionPerformed

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);

}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:24,代码来源:PreviewAssetAction.java

示例6: openScene

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:27,代码来源:SceneComposerTopComponent.java

示例7: openFile

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:12,代码来源:VehicleCreatorTopComponent.java

示例8: openScene

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:30,代码来源:NavMeshTopComponent.java

示例9: SceneRequest

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的package包/类
public SceneRequest(Object requester, com.jme3.scene.Spatial rootNode, ProjectAssetManager manager) {
    this.requester = requester;
    this.rootNode = rootNode;
    if (rootNode instanceof com.jme3.scene.Node) {
        this.jmeNode = NodeUtility.createNode((com.jme3.scene.Node) rootNode, true);
    }
    this.manager = manager;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:9,代码来源:SceneRequest.java

示例10: openFile

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的package包/类
public void openFile(BinaryModelDataObject file, Node spatial) {
    JmeNode node = NodeUtility.createNode(spatial, false);
    editorController = new VehicleEditorController(node, file);
    SceneApplication.getApplication().addSceneListener(this);
    currentRequest = new SceneRequest(this, node, file.getLookup().lookup(ProjectAssetManager.class));
    currentRequest.setWindowTitle("Vehicle Creator");
    currentRequest.setDataObject(file);
    currentRequest.setToolNode(editorController.getToolsNode());
    currentRequest.setHelpCtx(ctx);
    SceneApplication.getApplication().requestScene(currentRequest);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:12,代码来源:VehicleCreatorTopComponent.java

示例11: openScene

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);

    addSaveNode(jmeNode);

    //SceneUndoRedoManager m = Lookup.getDefault().lookup(SceneUndoRedoManager.class);//TODO remove this line

    Logger.getLogger(TerrainEditorTopComponent.class.getName()).finer("Terrain openScene " + file.getName());

    if (editorController != null) {
        editorController.cleanup();
    }
    editorController = new TerrainEditorController(jmeNode, file, this);
    this.currentRequest = request;
    request.setWindowTitle("TerrainEditor - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
    request.setToolNode(new Node("TerrainEditorToolNode"));
    SceneApplication.getApplication().requestScene(request);

    terrainDeletedNodeListener = new TerrainNodeListener();
    editorController.enableTextureButtons();

}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:37,代码来源:TerrainEditorTopComponent.java

示例12: openScene

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的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);

    addSaveNode(jmeNode);

    //SceneUndoRedoManager m = Lookup.getDefault().lookup(SceneUndoRedoManager.class);//TODO remove this line

    Logger.getLogger(TerrainEditorTopComponent.class.getName()).log(Level.FINER, "Terrain openScene {0}", file.getName());

    if (editorController != null) {
        editorController.cleanup();
    }
    
    //this.associateLookup( new AbstractLookup(content) ); // for saving alpha images
    
    editorController = new TerrainEditorController(jmeNode, file, this);
    
    
    this.sentRequest = request;
    request.setWindowTitle("TerrainEditor - " + manager.getRelativeAssetPath(file.getPrimaryFile().getPath()));
    request.setToolNode(new Node("TerrainEditorToolNode"));
    SceneApplication.getApplication().openScene(request);

    //terrainDeletedNodeListener = new TerrainNodeListener();
    //editorController.enableTextureButtons();

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:42,代码来源:TerrainEditorTopComponent.java

示例13: openScene

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的package包/类
/**
 * method to display the node tree of a plugin (threadsafe)
 *
 * @param request
 */
public void openScene(final SceneRequest request) {
    if (!started) {
        NotifyUtil.show("OpenGL context not started!", "Click here to go to troubleshooting web page.", MessageType.WARNING, lst, 0);
        return;
    }
    closeScene(currentSceneRequest, request);
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            if (request == null) {
                return;
            }
            currentSceneRequest = request;
            if (request.getDataNode() != null) {
                setCurrentFileNode(request.getDataNode());
            } else {
                setCurrentFileNode(null);
            }
            //TODO: handle this differently (no opened file)
            if (request.getRootNode() == null && request.getJmeNode() == null) {
                DataObject dobj = request.getDataObject();
                if (dobj != null) {
                    request.setJmeNode(NodeUtility.createNode(rootNode, dobj));
                } else {
                    request.setJmeNode(NodeUtility.createNode(rootNode, false));
                }
            }
            setHelpContext(request.getHelpCtx());
            setWindowTitle(request.getWindowTitle());
            if (request.getRequester() instanceof SceneApplication) {
                camController.enable();
            } else {
                camController.disable();
            }
            final AssetManager manager = request.getManager();
            request.setFakeApp(fakeApp);
            fakeApp.newAssetManager(manager);
            enqueue(new Callable() {
                public Object call() throws Exception {
                    if (manager != null) {
                        assetManager = manager;
                    }
                    Spatial model = request.getRootNode();
                    //TODO: use FakeApp internal root node, don't handle model vs clean scene here
                    if (model != null && model != rootNode) {
                        rootNode.attachChild(model);
                    }
                    if (request.getToolNode() != null) {
                        toolsNode.attachChild(request.getToolNode());
                    }
                    request.setDisplayed(true);
                    return null;
                }
            });
            notifyOpen(request);
        }
    });
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:63,代码来源:SceneApplication.java

示例14: actionPerformed

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的package包/类
public void actionPerformed(ActionEvent ev) {
    final ProjectAssetManager manager = context.getLookup().lookup(ProjectAssetManager.class);
    if (manager == null) {
        return;
    }
    Runnable call = new Runnable() {

        public void run() {
            ProgressHandle progressHandle = ProgressHandle.createHandle("Opening Model");
            progressHandle.start();
            try {
                manager.clearCache();

                final Spatial asset = context.loadAsset();

                if (asset != null) {
                    Node node = null;
                    if (asset instanceof Node) {
                        node = (Node) asset;
                    } else {
                        node = new Node("RootNode");
                        node.attachChild(asset);
                    }
                    JmeNode jmeNode = NodeUtility.createNode(node);
                    SceneApplication app = SceneApplication.getApplication();
                    SceneRequest request = new SceneRequest(app, jmeNode, manager);
                    request.setDataObject(context);
                    request.setWindowTitle("OpenGL Window - View Model");
                    app.openScene(request);
                } else {
                    DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("Error opening " + context.getPrimaryFile().getNameExt(), NotifyDescriptor.ERROR_MESSAGE));
                }
            }catch(Exception e){
                e.printStackTrace();
            }finally {
                progressHandle.finish();
            }
        }
    };
    new Thread(call).start();

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:43,代码来源:OpenModel.java

示例15: actionPerformed

import com.jme3.gde.core.sceneexplorer.nodes.NodeUtility; //导入依赖的package包/类
public void actionPerformed(ActionEvent ev) {
    final ProjectAssetManager manager = context.getLookup().lookup(ProjectAssetManager.class);
    if (manager == null) {
        return;
    }
    Runnable call = new Runnable() {

        public void run() {
            ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Opening Model");
            progressHandle.start();
            try {
                manager.clearCache();

                final Spatial asset = context.loadAsset();

                if (asset != null) {
                    Node node = null;
                    if (asset instanceof Node) {
                        node = (Node) asset;
                    } else {
                        node = new Node("RootNode");
                        node.attachChild(asset);
                    }
                    JmeNode jmeNode = NodeUtility.createNode(node);
                    SceneApplication app = SceneApplication.getApplication();
                    SceneRequest request = new SceneRequest(app, jmeNode, manager);
                    request.setDataObject(context);
                    request.setWindowTitle("OpenGL Window - View Model");
                    app.requestScene(request);
                } else {
                    Confirmation msg = new NotifyDescriptor.Confirmation(
                            "Error opening " + context.getPrimaryFile().getNameExt(),
                            NotifyDescriptor.OK_CANCEL_OPTION,
                            NotifyDescriptor.ERROR_MESSAGE);
                    DialogDisplayer.getDefault().notify(msg);
                }
            }catch(Exception e){
                e.printStackTrace();
            }finally {
                progressHandle.finish();
            }
        }
    };
    new Thread(call).start();

}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:47,代码来源:OpenModel.java


注:本文中的com.jme3.gde.core.sceneexplorer.nodes.NodeUtility类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。