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


Java SceneApplication.getApplication方法代码示例

本文整理汇总了Java中com.jme3.gde.core.scene.SceneApplication.getApplication方法的典型用法代码示例。如果您正苦于以下问题:Java SceneApplication.getApplication方法的具体用法?Java SceneApplication.getApplication怎么用?Java SceneApplication.getApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.gde.core.scene.SceneApplication的用法示例。


在下文中一共展示了SceneApplication.getApplication方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.jme3.gde.core.scene.SceneApplication; //导入方法依赖的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: NavMeshCameraController

import com.jme3.gde.core.scene.SceneApplication; //导入方法依赖的package包/类
public NavMeshCameraController(Camera cam) {
    super(cam, SceneApplication.getApplication().getInputManager());
    app = SceneApplication.getApplication();
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:5,代码来源:NavMeshCameraController.java

示例3: TerrainCameraController

import com.jme3.gde.core.scene.SceneApplication; //导入方法依赖的package包/类
public TerrainCameraController(Camera cam) {
    super(cam, SceneApplication.getApplication().getInputManager());
    app = SceneApplication.getApplication();
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:5,代码来源:TerrainCameraController.java

示例4: actionPerformed

import com.jme3.gde.core.scene.SceneApplication; //导入方法依赖的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

示例5: restored

import com.jme3.gde.core.scene.SceneApplication; //导入方法依赖的package包/类
@Override
public void restored() {
    //start scene app
    SceneApplication.getApplication();
    Logger.getLogger("org.openide.loaders").setLevel(Level.SEVERE);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:7,代码来源:Installer.java


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