Examples of MouseButtonEvent3D


Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

            updateRotations = false;
       
            int onmask = MouseEvent.BUTTON3_DOWN_MASK | MouseEvent.SHIFT_DOWN_MASK;
            for (Event e : events) {
                if (e instanceof MouseButtonEvent3D) {
                    MouseButtonEvent3D mbe = (MouseButtonEvent3D)e;
                    MouseEvent awt = (MouseEvent) mbe.getAwtEvent();
                    if (awt.getID()== MouseEvent.MOUSE_PRESSED && (awt.getModifiersEx() & onmask)==onmask ) {
                        lastMouseX = awt.getX();
                        lastMouseY = awt.getY();
                    }
                } else if (e instanceof MouseDraggedEvent3D) {
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

            // Figure out where the initial mouse button press happened and
            // store the initial position. We also store the center of the
            // affordance.
            if (event instanceof MouseButtonEvent3D) {
                MouseButtonEvent3D buttonEvent = (MouseButtonEvent3D)event;
                if (buttonEvent.isPressed() &&
                        buttonEvent.getButton() == ButtonId.BUTTON1) {
                   
                    // Figure out where the button press is in screen and world
                    // coordinates. Also fetch the current rotation for cell.
                    MouseEvent awtButtonEvent = (MouseEvent)buttonEvent.getAwtEvent();
                    dragStartScreen = new Point(awtButtonEvent.getX(), awtButtonEvent.getY());
                    dragStartWorld = buttonEvent.getIntersectionPointWorld();
                   
                    // Figure out the world coordinates of the center of the
                    // affordance.
                    Entity entity = event.getEntity();
                    RenderComponent rc = (RenderComponent)entity.getComponent(RenderComponent.class);
                    centerWorld = rc.getSceneRoot().getWorldTranslation();
                   
                    // Compute the vector from the starting point of the drag
                    // to the center of the affordance in world coordinates.
                    dragStartVectorWorld = dragStartWorld.subtract(centerWorld);

                    // Show the rotation label, make sure we do this in an
                    // AWT Event Thread
                    showRotationLabel(awtMouseEvent);

                    // Tell the listeners that a rotation has started
                    fireRotationStarted();
                }
                else if (buttonEvent.isReleased() == true) {
                    // Hide the position label, make sure we do this in an
                    // AWT Event Thread
                    hideRotationLabel();
                }
                return;
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

            MouseEvent awtMouseEvent = (MouseEvent)mouseEvent.getAwtEvent();

            // Figure out where the initial mouse button press happened and
            // store the initial position
            if (event instanceof MouseButtonEvent3D) {
                MouseButtonEvent3D buttonEvent = (MouseButtonEvent3D) event;
                if (buttonEvent.isPressed() &&
                        buttonEvent.getButton() == ButtonId.BUTTON1) {
                   
                    // Fetch the initial location of the mouse drag event and
                    // store away the necessary information
                    MouseEvent awtButtonEvent = (MouseEvent) buttonEvent.getAwtEvent();
                    dragStartScreen = new Point(awtButtonEvent.getX(), awtButtonEvent.getY());
                    dragStartWorld = buttonEvent.getIntersectionPointWorld();
                   
                    // Show the position label, make sure we do this in an
                    // AWT Event Thread
                    showPositionLabel(awtMouseEvent);

                    // Tell the listeners that a translation has started.
                    fireTranslationStarted();
                }
                else if (buttonEvent.isReleased() == true) {
                    // Hide the position label, make sure we do this in an
                    // AWT Event Thread
                    hidePositionLabel();
                }
                return;
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

            // Figure out where the initial mouse button press happened and
            // store the initial position. We also store the center of the
            // affordance.
            if (event instanceof MouseButtonEvent3D) {
                MouseButtonEvent3D be = (MouseButtonEvent3D)event;
                if (be.isPressed() && be.getButton() == ButtonId.BUTTON1) {
                   
                    // Figure out where the button press is in screen and world
                    // coordinates. Also fetch the current rotation for cell.
                    MouseEvent awtButtonEvent = (MouseEvent)be.getAwtEvent();
                    dragStartScreen = new Point(awtButtonEvent.getX(), awtButtonEvent.getY());
                    dragStartWorld = be.getIntersectionPointWorld();

                    // Figure out the world coordinates of the center of the
                    // affordance.
                    Entity entity = event.getEntity();
                    RenderComponent rc = (RenderComponent)entity.getComponent(RenderComponent.class);
                    Vector3f centerWorld = rc.getSceneRoot().getWorldTranslation();

                    // Compute the vector from the starting point of the drag
                    // to the center of the affordance in world coordinates.
                    dragStartVectorWorld = dragStartWorld.subtract(centerWorld);
                    dragStartRadius = dragStartVectorWorld.length();

                    // Show the resize label, make sure we do this in an
                    // AWT Event Thread
                    showResizeLabel(awtMouseEvent);

                    // Tell the listeners that a resizing has started
                    fireResizingStarted();
                } else if (be.isReleased() == true) {
                    // Hide the resize label, make sure we do this in an
                    // AWT Event Thread
                    hideResizeLabel();
                }
                return;
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

        }

        @Override
        public void commitEvent(Event event) {
            if (event instanceof MouseButtonEvent3D) {
                MouseButtonEvent3D buttonEvent = (MouseButtonEvent3D) event;
                if (buttonEvent.isPressed() && buttonEvent.getButton() == ButtonId.BUTTON1) {
                    ((PhoneCell) cell).phoneSelected();
                }
            }
        }
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

    public boolean isClearedSelection(Event event) {
        // If the event carries no Entity (happens on the background), or if
        // the Entity that is clicked is not-selectable (NOT YET IMPLEMENTED)
        // then clear the existing selection.
        if (event instanceof MouseButtonEvent3D) {
            MouseButtonEvent3D mbe = (MouseButtonEvent3D)event;
            return mbe.isPressed() == true && mbe.getEntity() == null &&
                    mbe.getButton() == ButtonId.BUTTON1;
        }
        return false;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

    public boolean isSingleSelection(Event event) {
        // If the event carries an Entity that is selectable (NOT YET IMPLEMENTED)
        // and it is a left-mouse button press with no shift key
        if (event instanceof MouseButtonEvent3D) {
            MouseButtonEvent3D mbe = (MouseButtonEvent3D)event;
            return mbe.isPressed() == true && mbe.getEntity() != null &&
                    mbe.getButton() == ButtonId.BUTTON1 &&
                    mbe.getAwtEvent().isShiftDown() == false &&
                    isSelectable(mbe.getEntity());
        }
        return false;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

    public boolean isMultiSelection(Event event) {
        // If the event carries an Entity that is selectable (NOT YET IMPLEMENTED)
        // and it is a left-mouse button press with a shift key
        if (event instanceof MouseButtonEvent3D) {
            MouseButtonEvent3D mbe = (MouseButtonEvent3D)event;
            return mbe.isPressed() == true && mbe.getEntity() != null &&
                    mbe.getButton() == ButtonId.BUTTON1 &&
                    mbe.getAwtEvent().isShiftDown() == true &&
                    isSelectable(mbe.getEntity());
        }
        return false;       
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

    public boolean isActivation(Event event) {
        // If the event carries an Entity that can be activated (N.Y.I) and
        // is a double-click with the left-mouse button
        if (event instanceof MouseButtonEvent3D) {
            MouseButtonEvent3D mbe = (MouseButtonEvent3D)event;
            return mbe.isClicked() == true && mbe.getEntity() != null &&
                    mbe.getButton() == ButtonId.BUTTON1 &&
                    mbe.getClickCount() == 2;
        }
        return false;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.jme.input.MouseButtonEvent3D

        // If the event is a press of the right-mouse button and there is an
        // Entity. Look to see if any modifiers are present on the event, and
        // if so, then ignore the event.
        if (event instanceof MouseButtonEvent3D) {
            // If the event is not pressed and not for button 3 then ignore
            MouseButtonEvent3D mbe = (MouseButtonEvent3D) event;
            ButtonId button = mbe.getButton();
            if (mbe.isPressed() == false || button != ButtonId.BUTTON3) {
                return false;
            }

            // Check to see if there are any modifiers present. If so, then
            // ignore. The only modifier that should be present is BUTTON3
            ModifierId[] ids = mbe.getModifiersEx(null);
            for (ModifierId id : ids) {
                if (id != ModifierId.BUTTON3) {
                    return false;
                }
            }

            // is the entity selectable?
            if (mbe.getEntity() != null) {
                return isSelectable(mbe.getEntity());
            }

            return true;
        }
        return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.