Package org.jdesktop.wonderland.client.hud

Examples of org.jdesktop.wonderland.client.hud.HUD


    private void AnswerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AnswerButtonActionPerformed
        logger.info("Sent join accepted message");

        AddHUDPanel addHUDPanel = new AddHUDPanel(client, session, myPresenceInfo, caller, group, Mode.IN_PROGRESS);

        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
        addComponent = mainHUD.createComponent(addHUDPanel);
        addComponent.setIcon(new ImageIcon(getClass().getResource("/org/jdesktop/wonderland/modules/audiomanager/client/resources/UserListChatVoice32x32.png")));
  addComponent.setName("Voice Chat");

        addHUDPanel.setHUDComponent(addComponent);

        addHUDPanel.setPreferredLocation(Layout.NORTHWEST);

        mainHUD.addComponent(addComponent);

        addComponent.addEventListener(new HUDEventListener() {
            public void HUDObjectChanged(HUDEvent e) {
                if (e.getEventType().equals(HUDEventType.CLOSED)) {
        addComponent = null;
View Full Code Here


        display.addComponentListener(new ComponentListener() {

            public void componentResized(ComponentEvent e) {
                Iterator<String> iter = huds.keySet().iterator();
                while (iter.hasNext()) {
                    HUD hud = huds.get(iter.next());
                    hud.setDisplayBounds(e.getComponent().getSize());
                }
            }

            public void componentMoved(ComponentEvent e) {
            }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public HUD getHUD(String name) {
        HUD hud = null;
        if (name != null) {
            hud = huds.get(name);
        }
        return hud;
    }
View Full Code Here

        if (event.getObject() instanceof HUD) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("HUDManager received HUD event: " + event);
            }

            HUD hud = (HUD) event.getObject();

            switch (event.getEventType()) {
                case ADDED:
                    break;
                case REMOVED:
View Full Code Here

        // create the main Wonderland HUD
        //
        logger.fine("creating main HUD: " +
                DEFAULT_HUD_WIDTH + "x" + DEFAULT_HUD_HEIGHT +
                " at " + DEFAULT_HUD_X + ", " + DEFAULT_HUD_Y);
        final HUD wonderlandHUD = HUDFactory.createHUD(canvas.getSize(),
                DEFAULT_HUD_X, DEFAULT_HUD_Y, DEFAULT_HUD_WIDTH, DEFAULT_HUD_HEIGHT);
        wonderlandHUD.setName("main");

        // create the default HUD Manager factory
        HUDManagerFactory.setHUDManagerFactorySPI(new WonderlandHUDManagerFactory());

        // create a HUD manager instance to manage all the HUDs
        HUDManager manager = HUDManagerFactory.createHUDManager(canvas);

        // define how HUDs are laid out on the screen
        manager.setLayoutManager(new HUDAbsoluteLayoutManager(wonderlandHUD));

        // manage the main HUD
        manager.addHUD(wonderlandHUD);

        // create a component manager for the HUD components in this HUD
        HUDComponentManager compManager = new WonderlandHUDComponentManager(wonderlandHUD);

        // define the layout of HUD components in the Wonderland main HUD
        compManager.setLayoutManager(new HUDCompassLayoutManager(wonderlandHUD));

        // manage the components in the main HUD
        wonderlandHUD.addEventListener(compManager);

        // create a HUD for icons
        //
        logger.fine("creating icon HUD: " + DEFAULT_HUD_WIDTH + "x" + ICON_HUD_HEIGHT +
                " at " + DEFAULT_HUD_X + ", " + DEFAULT_HUD_Y);
        final HUD iconHUD = HUDFactory.createHUD(canvas.getSize(),
                DEFAULT_HUD_X, DEFAULT_HUD_Y, DEFAULT_HUD_WIDTH, ICON_HUD_HEIGHT);
        iconHUD.setName("icon");

        // manage the icon bar HUD
        manager.addHUD(iconHUD);

        // create a component manager for the HUD components in the icon HUD
        HUDComponentManager iconCompManager = new WonderlandHUDIconManager(iconHUD);

        // define the layout of HUD components in the icon HUD
        iconCompManager.setLayoutManager(new HUDFlowLayoutManager(iconHUD));

        // icon manager manages components in the main HUD
        wonderlandHUD.addEventListener(iconCompManager);

        // icon manager manages components in the icon HUD too
        iconHUD.addEventListener(iconCompManager);

        // call the superclass's initialize method
        super.initialize(loginManager);
    }
View Full Code Here

            listener.userInRange(info, userInRange, isInRange);
        }
    }

    public void removeDialogs() {
        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
       
        if (vuMeterComponent != null) {
            vuMeterComponent.setVisible(false);
            mainHUD.removeComponent(vuMeterComponent);
            vuMeterComponent = null;
        }

        if (vuMeterMiniComponent != null) {
            vuMeterMiniComponent.setVisible(false);
            mainHUD.removeComponent(vuMeterMiniComponent);
            vuMeterComponent = null;
        }
    }
View Full Code Here

        }

        AddHUDPanel addPanel = new AddHUDPanel(
                this, session, presenceInfo, presenceInfo, Mode.INITIATE);

        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");

        final HUDComponent addComponent = mainHUD.createComponent(addPanel);
        addPanel.setHUDComponent(addComponent);
        addComponent.setPreferredLocation(Layout.CENTER);
        addComponent.setName(BUNDLE.getString("Voice_Chat"));
        addComponent.setIcon(voiceChatIcon);
        mainHUD.addComponent(addComponent);
        addComponent.addEventListener(new HUDEventListener() {

            public void HUDObjectChanged(HUDEvent e) {
                if (e.getEventType().equals(HUDEventType.DISAPPEARED)) {
                }
View Full Code Here

        miniVUMeter = true;

        if (vuMeterMiniComponent == null) {
            final VuMeterMiniPanel vuMeterPanel = new VuMeterMiniPanel(this);

            HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");

            vuMeterMiniComponent = mainHUD.createComponent(vuMeterPanel);
            vuMeterMiniComponent.setPreferredLocation(Layout.SOUTHEAST);
            vuMeterMiniComponent.setName(BUNDLE.getString("Microphone_Level"));
            vuMeterMiniComponent.setIcon(voiceChatIcon);
            vuMeterMiniComponent.setDecoratable(false);
            vuMeterMiniComponent.addEventListener(audioMeterListener);
            mainHUD.addComponent(vuMeterMiniComponent);
        }

        if (vuMeterComponent != null) {
            vuMeterComponent.setVisible(false);
        }
View Full Code Here

        miniVUMeter = false;

        if (vuMeterComponent == null) {
            final VuMeterPanel vuMeterPanel = new VuMeterPanel(this);

            HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");

            vuMeterComponent = mainHUD.createComponent(vuMeterPanel);
            vuMeterComponent.setPreferredLocation(Layout.SOUTHEAST);
            vuMeterComponent.setName(BUNDLE.getString("Microphone_Level"));
            vuMeterComponent.setIcon(voiceChatIcon);
            vuMeterComponent.addEventListener(new HUDEventListener() {

                public void HUDObjectChanged(HUDEvent event) {
                    switch (event.getEventType()) {
                        case APPEARED:
                            vuMeterPanel.startVuMeter(true);
                            break;
                        case DISAPPEARED:
                            vuMeterPanel.startVuMeter(false);
                            break;
                        default:
                            break;
                    }
                }
            });
            vuMeterComponent.addEventListener(audioMeterListener);
            mainHUD.addComponent(vuMeterComponent);
            vuMeterPanel.startVuMeter(true);
        }

        if (vuMeterMiniComponent != null) {
            vuMeterMiniComponent.setVisible(false);
View Full Code Here

            final IncomingCallHUDPanel incomingCallHUDPanel =
                    new IncomingCallHUDPanel(this, session, cell.getCellID(),
                    (VoiceChatJoinRequestMessage) message);

            HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
            final HUDComponent incomingCallHUDComponent =
                    mainHUD.createComponent(incomingCallHUDPanel);
            incomingCallHUDPanel.setHUDComponent(incomingCallHUDComponent);
            incomingCallHUDComponent.setPreferredLocation(Layout.CENTER);
            incomingCallHUDComponent.setIcon(voiceChatIcon);

            mainHUD.addComponent(incomingCallHUDComponent);
            incomingCallHUDComponent.addEventListener(new HUDEventListener() {

                public void HUDObjectChanged(HUDEvent e) {
                    if (e.getEventType().equals(HUDEventType.DISAPPEARED)) {
                        incomingCallHUDPanel.busy();
                    }
                }
            });

            incomingCallHUDComponent.setVisible(true);
            return;
        }

        if (message instanceof VoiceChatBusyMessage) {
            VoiceChatBusyMessage msg = (VoiceChatBusyMessage) message;

            VoiceChatBusyHUDPanel voiceChatBusyHUDPanel =
                    new VoiceChatBusyHUDPanel(msg.getCallee());
            HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
            HUDComponent voiceChatBusyHUDComponent =
                    mainHUD.createComponent(voiceChatBusyHUDPanel);
            voiceChatBusyHUDPanel.setHUDComponent(voiceChatBusyHUDComponent);
            voiceChatBusyHUDComponent.setPreferredLocation(Layout.CENTER);
            voiceChatBusyHUDComponent.setIcon(voiceChatIcon);

            mainHUD.addComponent(voiceChatBusyHUDComponent);
            voiceChatBusyHUDComponent.addEventListener(new HUDEventListener() {

                public void HUDObjectChanged(HUDEvent e) {
                    if (e.getEventType().equals(HUDEventType.DISAPPEARED)) {
                    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.client.hud.HUD

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.