Package org.jdesktop.wonderland.modules.appbase.client

Examples of org.jdesktop.wonderland.modules.appbase.client.ControlArb


                    // potentially viewable, so we release control of the app if
                    // it is controlled. We did a similar thing in 0.4
                    // Wonderland, where we released control on a teleport. But
                    // this is a more elegant solution.
                    if (app != null) {
                        ControlArb controlArb = app.getControlArb();
                        if (controlArb != null) {
                            if (controlArb.hasControl()) {
                                controlArb.releaseControl();
                            }
                        }
                    }
                }
                break;
View Full Code Here


            }
        });

        // track changes in control state of this window
        App2D app = window.getApp();
        ControlArb arbiter = app.getControlArb();
        if (arbiter != null) {
            arbiter.addListener(this);
        }
    }
View Full Code Here

        boolean control = false;

        if (window != null) {
            App2D app = window.getApp();
            if (app != null) {
                ControlArb arbiter = app.getControlArb();
                if (arbiter != null) {
                    control = arbiter.hasControl();
                }
            }
        }

        return control;
View Full Code Here

        //logger.severe("Gui misc action = " + action.type);

        switch (action.type) {

            case TOGGLE_CONTROL:
                ControlArb controlArb = view.getWindow().getApp().getControlArb();
                if (controlArb.hasControl()) {
                    logger.info("Release control");
                    controlArb.releaseControl();
                } else {
                    logger.info("Take control");
                    controlArb.takeControl();
                }
                break;
        }
    }
View Full Code Here

                return;
            }
            */

            if (view != null) {
                final ControlArb controlArb = view.getWindow().getApp().getControlArb();
                if (controlArb.hasControl()) {
                    SwingUtilities.invokeLater(new Runnable () {
                        public void run () {
                            // Note: currently no special GUI processing is needed for key events
                            // so they are all just sent to the app group if it has control
                            controlArb.deliverEvent(view.getWindow(), ke);
                        }
                    });
                }
            }
        }
View Full Code Here

            logger.fine("WS.consumesEvent: " + awtEvent);
            if (Gui2D.isChangeControlEvent(awtEvent)) {
                logger.fine("Is Change Control Event");

                // Perform the control toggle immediately
                ControlArb controlArb = app.getControlArb();
                if (controlArb != null) {
                    if (controlArb.hasControl()) {
                        controlArb.releaseControl();
                    } else {
                        controlArb.takeControl();
                    }
                }
                return EventAction.DISCARD;
            }
            logger.fine("Isn't change control event " + awtEvent);
View Full Code Here

    /**
     * Returns the name of the controlling user.
     */
    public String getControllingUser() {
        ControlArb controlArb = app.getControlArb();
        if (controlArb instanceof ControlArbNull) return null;
        return ((ControlArbXrw) controlArb).getController();
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.appbase.client.ControlArb

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.