Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.Entity


        this.newGeometryNode = geometryNode;

        name = "View for " + window.getName();

        // Create entity and node
        entity = new Entity("Entity for " + name);
        viewNode = new Node("Node for " + name);
        RenderComponent rc =
            ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(viewNode);
        entity.addComponent(RenderComponent.class, rc);
        entityMakePickable(entity);
View Full Code Here


     */
    public Frame2DCell (View2DCell view) {
        this.view = view;
        name = "Frame for " + view.getName();

        frameEntity = new Entity("Entity for " + name);
        frameNode = new Node("Node for " + name);
        RenderComponent rc =
                ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(frameNode);
        frameEntity.addComponent(RenderComponent.class, rc);

View Full Code Here

        view = null;
    }

    public void attachToViewEntity () {
        if (attached) return;
        Entity viewEntity = view.getEntity();
        if (viewEntity == null) return;

        viewEntity.addEntity(frameEntity);

        RenderComponent rcFrame = (RenderComponent) frameEntity.getComponent(RenderComponent.class);

        if (rcFrame != null) {
            // We need to attach secondary view frames to the GEOMETRY NODE of its views
View Full Code Here

    }

    public void detachFromViewEntity () {
        if (!attached) return;

        Entity viewEntity = view.getEntity();
        if (viewEntity == null) return;
        viewEntity.removeEntity(frameEntity);
        RenderComponent rcFrame = (RenderComponent) frameEntity.getComponent(RenderComponent.class);
        if (rcFrame != null) {
            rcFrame.setAttachPoint(null);
        }
        if (header != null) {
View Full Code Here

     * Initialize this component's entity.
     */
    protected void initEntity() {

        // Create this component's entity and parent it
        entity = new Entity("Entity for frame component " + name);

        // Create this component scene graph (l2c -> geometry)
        initSceneGraph();

        // Make the entity pickable
View Full Code Here

    // For debug
    public static void printOrthoNodes () {
        // Print ortho nodes attached to the world manager
        WorldManager wm = ClientContextJME.getWorldManager();
        for (int i=0; i < wm.numEntities(); i++) {
            Entity e = wm.getEntity(i);
            RenderComponent rc = (RenderComponent) e.getComponent(RenderComponent.class);
            if (rc == null || !rc.getOrtho()) continue;
            System.err.println("Ortho node = " + rc.getSceneRoot());
            GraphicsUtils.printNode(rc.getSceneRoot());
        }
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected Entity getParentEntity() {
        Entity parentEntity = null;
        Entity cellEntity = ((CellRendererJME) cell.getCellRenderer(Cell.RendererType.RENDERER_JME)).getEntity();

        switch (type) {
            case UNKNOWN:
            case PRIMARY:
                // Attach primaries directly to cell entity
View Full Code Here

        if (logger.isLoggable(Level.FINEST)) {
            logger.finest("attach view: " + view);
            logger.finest("to: " + this);
        }

        Entity e = view.getEntity();
        RenderComponent rcFrame = (RenderComponent) e.getComponent(RenderComponent.class);
        rcFrame.setAttachPoint(this.getGeometryNode());
    }
View Full Code Here

        if (logger.isLoggable(Level.FINEST)) {
            logger.finest("detach view: " + view);
            logger.finest("from: " + this);
        }

        Entity viewEntity = view.getEntity();
        if (viewEntity == null) {
            return;
        }
        entity.removeEntity(viewEntity);
        RenderComponent rcFrame = (RenderComponent) viewEntity.getComponent(RenderComponent.class);
        if (rcFrame != null) {
            rcFrame.setAttachPoint(null);
        }
    }
View Full Code Here

                // if the global entity does not have focus, ignore this event
                // because it is going to a shared app
                KeyEvent ke = new KeyEvent(canvas, KeyEvent.KEY_PRESSED,
                        e.getWhen(), 0, KeyEvent.VK_SPACE, ' ');
                Entity global = InputManager.inputManager().getGlobalFocusEntity();
                if (!InputManager.entityHasFocus(ke, global)) {
                    return;
                }

                // if we are on mute, pressing space triggers a push to talk.
View Full Code Here

TOP

Related Classes of org.jdesktop.mtgame.Entity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.