⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 universemanager.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
字号:
/** * Copyright (c) 1999 Justin Couch Java Source Raw J3D * Tutorial Version History Date Version Programmer * ---------- ------- ------------------------------------------ * 01/08/1998 1.0.0 Justin Couch */package com.bbn.openmap.tools.j3d;import javax.media.j3d.*;/** * Test class for representing a universe * <P> *  * Basic universe consisting of a default Locale and three branch * graphs for objects that exist in the display and world spaces, as * well as a separate branch for cameras. *  * @author Justin Couch * @version Who Cares! */public class UniverseManager extends VirtualUniverse {    private Locale locale;    private BranchGroup view_group;    private BranchGroup world_object_group;    /**     * Create the basic universe and all of the supporting     * infrastructure that is needed by a J3D application. The default     * setup just uses a single local located at the origin.     */    public UniverseManager() {        this(null);    }    /**     * Create the basic universe and all of the supporting     * infrastructure that is needed by a J3D application. The default     * setup just uses a single local located at the origin.     *      * @param worldGroup Description of the Parameter     */    public UniverseManager(BranchGroup worldGroup) {        locale = new Locale(this);        view_group = new BranchGroup();        view_group.setCapability(Group.ALLOW_CHILDREN_EXTEND);        if (worldGroup == null) {            world_object_group = new BranchGroup();            world_object_group.setCapability(Group.ALLOW_CHILDREN_EXTEND);        } else {            world_object_group = worldGroup;        }    }    /**     * Add a camera to the world.     *      * @param cam The camera that may be added     */    public void addCamera(Camera cam) {        view_group.addChild(cam.getNode());    }    /**     * Add an object to the world object group.     *      * @param node The node that may be added     */    public void addWorldObject(Node node) {        world_object_group.addChild(node);    }    public BranchGroup getWorldBranchGroup() {        return world_object_group;    }    /**     * Make the universe live by adding the objects to the locale     */    public void makeLive() {        view_group.compile();        world_object_group.compile();        locale.addBranchGraph(view_group);        locale.addBranchGraph(world_object_group);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -