Package org.jdesktop.wonderland.client.jme

Examples of org.jdesktop.wonderland.client.jme.MainFrame$ServerURLListener


                Math.abs((fromLoc.y)-(toLoc.y))<=150 &&
                Math.abs((fromLoc.z)-(toLoc.z))<=150) {
            //Cover Screen not needed
        } else {
            //attach cover screen
            final MainFrame mainFrame =  JmeClientMain.getFrame();
            final Canvas canvas = mainFrame.getCanvas();
            final CoverScreen coverScreenPanel = new CoverScreen(csd,canvas.getSize());
           
            try {
                //show cover screen in JDialog over the canvas panel
                SwingUtilities.invokeLater(new Runnable() {

                    public void run() {
                        dialog = new JDialog(mainFrame.getFrame(), "Child", false);
                        coverScreenPanel.setPreferredSize(canvas.getSize());
                        dialog.setSize(canvas.getSize().width
                                ,canvas.getSize().height);
                        dialog.setLocation(canvas.getLocationOnScreen().x
                                ,canvas.getLocationOnScreen().y);
                       
                        mainFrame.getFrame().addComponentListener(new ComponentAdapter() {

                            private void doChange() {
                                SwingUtilities.invokeLater(new Runnable() {
                                    public void run() {
                                        if (dialog != null && dialog.isVisible()) {
                                            Component cs = dialog.getComponent(0);
                                            Canvas canvas = mainFrame.getCanvas();
                                            cs.setPreferredSize(canvas.getSize());
                                            dialog.setSize(canvas.getSize().width, canvas.getSize().height);
                                            dialog.setLocation(canvas.getLocationOnScreen().x, canvas.getLocationOnScreen().y);
                                            dialog.pack();
                                            dialog.setVisible(true);
View Full Code Here


        // First remove the menus. This will prevent users from taking action
        // upon the avatar in the (small) chance they do while the session is
        // being deactivated.
        if (menusAdded == true) {
            MainFrame frame = JmeClientMain.getFrame();
            frame.removeFromWindowMenu(gestureMI);
            frame.removeFromToolsMenu(collisionResponseEnabledMI);
            frame.removeFromToolsMenu(gravityEnabledMI);
            frame.removeFromEditMenu(avatarConfigMI);
           
            if (frame instanceof MainFrameImpl) { // Until MainFrame gets this method added
                ((MainFrameImpl) frame).removeFromCameraChoices(chaseCameraMI);
            }
            else {
                frame.removeFromViewMenu(chaseCameraMI);
            }

            // Remove the avatar controls (test) if it exists
            if (avatarControlsMI != null) {
                frame.removeFromWindowMenu(avatarControlsMI);
            }

            // Add the avatar instrumentions settings if it exists
            if (avatarSettingsMI != null) {
                frame.removeFromEditMenu(avatarSettingsMI);
            }
            menusAdded = false;
        }

        // Next, remove the listener for changes in avatar in use. This will
View Full Code Here

        // Finally, enable the menu items to allow avatar configuration. We
        // do this after the view cell is set, so we know we have an avatar
        // in the world.
        if (menusAdded == false) {
            MainFrame frame = JmeClientMain.getFrame();
            frame.addToWindowMenu(gestureMI, 0);
            frame.addToToolsMenu(gravityEnabledMI, 3);
            frame.addToToolsMenu(collisionResponseEnabledMI, 2);
            frame.addToEditMenu(avatarConfigMI, 0);

            if (frame instanceof MainFrameImpl) { // Only until the MainFrame interface gets this method
                ((MainFrameImpl) frame).addToCameraChoices(chaseCameraMI, 3);
            }
            else {
                frame.addToViewMenu(chaseCameraMI, 3);
            }

            // Add the avatar control (test) if it exists
            if (avatarControlsMI != null) {
                frame.addToWindowMenu(avatarControlsMI, 0);
            }

            // Add the avatar instrumentation settings if it exists
            if (avatarSettingsMI != null) {
                frame.addToEditMenu(avatarSettingsMI, 1);
            }
            menusAdded = true;
        }
    }
View Full Code Here

                && Math.abs((fromLoc.y) - (toLoc.y)) <= 150
                && Math.abs((fromLoc.z) - (toLoc.z)) <= 150) {
            //Cover Screen not needed
        } else {
            //attach cover screen
            final MainFrame mainFrame = JmeClientMain.getFrame();
            final Canvas canvas = mainFrame.getCanvas();
            final CoverScreen coverScreenPanel = new CoverScreen(csd, canvas.getSize());

            try {

                //show cover screen in JDialog over the canvas panel
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        dialog = new JDialog(mainFrame.getFrame(), "Child", false);

                        coverScreenPanel.setPreferredSize(canvas.getSize());
                        dialog.setSize(canvas.getSize().width, canvas.getSize().height);
                        dialog.setLocation(canvas.getLocationOnScreen().x, canvas.getLocationOnScreen().y);

                        mainFrame.getFrame().addComponentListener(new ComponentAdapter() {
                            private void doChange() {
                                SwingUtilities.invokeLater(new Runnable() {
                                    public void run() {
                                        if (dialog != null && dialog.isVisible()) {
                                            Component cs = dialog.getComponent(0);
                                            Canvas canvas = mainFrame.getCanvas();
                                            cs.setPreferredSize(canvas.getSize());
                                            dialog.setSize(canvas.getSize().width, canvas.getSize().height);
                                            dialog.setLocation(canvas.getLocationOnScreen().x, canvas.getLocationOnScreen().y);
                                            dialog.pack();
                                            dialog.setVisible(true);
View Full Code Here

    private JMenuItem menuItem;
    private GroupManagerFrame gmf;

    @Override
    protected void activate() {
        MainFrame mf = JmeClientMain.getFrame();
        if (mf == null) {
            return;
        }

        if (menuItem == null) {
            menuItem = new JMenuItem(
                    new AbstractAction(BUNDLE.getString("Groups...")) {
                        public void actionPerformed(ActionEvent e) {
                            if (gmf == null) {
                                ServerSessionManager manager =
                                        getSessionManager();
                                gmf = new GroupManagerFrame(
                                        manager.getServerURL(),
                                        manager.getCredentialManager());
                            }

                            gmf.setVisible(true);
                        }
                    });
        }

        mf.addToEditMenu(menuItem, 2);
    }
View Full Code Here

        mf.addToEditMenu(menuItem, 2);
    }

    @Override
    protected void deactivate() {
        MainFrame mf = JmeClientMain.getFrame();
        if (mf == null || menuItem == null) {
            return;
        }
        mf.removeFromEditMenu(menuItem);
    }
View Full Code Here

                embeddedPeer = null;
            }
            return;
        }

        MainFrame frame = JmeClientMain.getFrame();
        JPanel embeddedParent = frame.getCanvas3DPanel();
        if (embeddedParent == null) {
            logger.warning("Embedded parent is null");
            return;
        }
View Full Code Here

                Math.abs((fromLoc.y)-(toLoc.y))<=150 &&
                Math.abs((fromLoc.z)-(toLoc.z))<=150) {
            //Cover Screen not needed
        } else {
            //attach cover screen
            final MainFrame mainFrame =  JmeClientMain.getFrame();
            final Canvas canvas = mainFrame.getCanvas();
            final CoverScreen coverScreenPanel = new CoverScreen(csd,canvas.getSize());
           
            try {
                //show cover screen in JDialog over the canvas panel
                SwingUtilities.invokeLater(new Runnable() {

                    public void run() {
                        dialog = new JDialog(mainFrame.getFrame(), "Child", false);
                        coverScreenPanel.setPreferredSize(canvas.getSize());
                        dialog.setSize(canvas.getSize().width
                                ,canvas.getSize().height);
                        dialog.setLocation(canvas.getLocationOnScreen().x
                                ,canvas.getLocationOnScreen().y);
                        JButton button = new JButton("Button");
                        button.addActionListener(new ActionListener() {
                          @Override
                          public void actionPerformed(ActionEvent e) {
                            dialog.dispose();
                          }
                        });
                        mainFrame.getFrame().addComponentListener(new ComponentAdapter() {

                            private void doChange() {
                                SwingUtilities.invokeLater(new Runnable() {
                                    public void run() {
                                        if (dialog != null && dialog.isVisible()) {
                                            Component cs = dialog.getComponent(0);
                                            Canvas canvas = mainFrame.getCanvas();
                                            cs.setPreferredSize(canvas.getSize());
                                            dialog.setSize(canvas.getSize().width, canvas.getSize().height);
                                            dialog.setLocation(canvas.getLocationOnScreen().x, canvas.getLocationOnScreen().y);
                                            dialog.pack();
                                            dialog.setVisible(true);
View Full Code Here

    public Cell getCell() {
        return cell;
    }

    public void addMenus() {
        MainFrame mainFrame = JmeClientMain.getFrame();
        mainFrame.addToToolsMenu(AudioMenu.getAudioMenuItem(this), 1);

        AudioMenu.getAudioMenu(this).addMenus();

        // make sure menus are up-to-date
        AudioMenu.getAudioMenu(this).mute(isMute());
View Full Code Here

        ContextMenuManager.getContextMenuManager().addContextMenuListener(ctxListener);
    }

    public void removeMenus() {
        MainFrame mainFrame = JmeClientMain.getFrame();
        mainFrame.removeFromToolsMenu(AudioMenu.getAudioMenuItem(this));

        AudioMenu.getAudioMenu(this).removeMenus();

        ContextMenuManager.getContextMenuManager().removeContextMenuListener(ctxListener);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.jme.MainFrame$ServerURLListener

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.