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