Package org.jdesktop.wonderland.modules.audiomanager.client.voicechat

Examples of org.jdesktop.wonderland.modules.audiomanager.client.voicechat.AddHUDPanel


        WonderlandSession session = model.getSession();
       
        PresenceInfo mine = (PresenceInfo)model.getLocalPresenceInfo().clone();
        PresenceInfo caller = (PresenceInfo)model.getLocalPresenceInfo().clone();
       
        AddHUDPanel addHUDPanel = new AddHUDPanel(client,
                                                  session,
                                                  mine,
                                                  caller,
                                                  AddHUDPanel.Mode.INITIATE);

        addHUDPanel.setPhoneType();

        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
        HUDComponent addHUDComponent = mainHUD.createComponent(addHUDPanel);
        addHUDComponent.setName(BUNDLE.getString("Call"));
        addHUDComponent.setIcon(new ImageIcon(getClass().getResource(
                "/org/jdesktop/wonderland/modules/audiomanager/client/"
                + "resources/UserListChatVoice32x32.png")));
        addHUDComponent.setPreferredLocation(CompassLayout.Layout.CENTER);

        addHUDPanel.setHUDComponent(addHUDComponent);

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

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

        PropertyChangeListener plistener = new PropertyChangeListener() {

            public void propertyChange(PropertyChangeEvent pe) {
            }
        };

        addHUDPanel.addPropertyChangeListener(plistener);
        addHUDComponent.setVisible(true);

    }
View Full Code Here


    }

    public void startVoiceChat(List<PresenceInfo> usersToInvite,
                               HUDComponent parent)
    {
        AddHUDPanel addHUDPanel = new AddHUDPanel(client, session, me,
                                                  me, Mode.IN_PROGRESS);

        addHUDPanel.inviteUsers(new ArrayList<PresenceInfo>(usersToInvite));

        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
        final HUDComponent hudComponent = mainHUD.createComponent(addHUDPanel);
        addHUDPanel.setHUDComponent(hudComponent);
        hudComponent.setName(BUNDLE.getString("Voice_Chat"));
        hudComponent.setIcon(new ImageIcon(getClass().getResource(
                "/org/jdesktop/wonderland/modules/audiomanager/client/"
                + "resources/UserListChatVoice32x32.png")));
        mainHUD.addComponent(hudComponent);
      
        PropertyChangeListener plistener = new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent pe) {
                String name = pe.getPropertyName();
                if (name.equals("ok") || name.equals("cancel")) {
                    hudComponent.setVisible(false);
                }
            }
        };

        addHUDPanel.addPropertyChangeListener(plistener);
        hudComponent.setPreferredLocation(Layout.CENTER);
        hudComponent.setVisible(true);

        if (parent != null) {
           addHUDPanel.setLocation(parent.getX() + parent.getWidth(),
                                   parent.getY() + parent.getHeight()
                                   - hudComponent.getHeight());
        }
    }
View Full Code Here

    public void voiceChat() {
        if (presenceInfo == null) {
            return;
        }

        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)) {
                }
            }
        });

        PropertyChangeListener plistener = new PropertyChangeListener() {

            public void propertyChange(PropertyChangeEvent pe) {
                String propName = pe.getPropertyName();
                if (propName.equals("ok") || propName.equals("cancel")) {
                    addComponent.setVisible(false);
                }
            }
        };
        addPanel.addPropertyChangeListener(plistener);
        addComponent.setVisible(true);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.audiomanager.client.voicechat.AddHUDPanel

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.