示例#1
0
  private void addButtonActionPerformed(ActionEvent e) {
    AddHUDPanel addHUDPanel =
        new AddHUDPanel(client, session, myPresenceInfo, myPresenceInfo, group, Mode.ADD);

    addHUDPanel.setPrivacy(addUserPanel.getPrivacy());

    HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
    addModeAddHUDComponent = mainHUD.createComponent(addHUDPanel);
    addHUDPanel.setHUDComponent(addModeAddHUDComponent);

    addModeAddHUDComponent.setName("Add to Voice Chat");

    addHUDPanel.setPreferredLocation(Layout.EAST);

    mainHUD.addComponent(addModeAddHUDComponent);

    inProgressButtonPanel.setEnabledAddButton(false);

    addModeAddHUDComponent.addEventListener(
        new HUDEventListener() {

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

    PropertyChangeListener plistener =
        new PropertyChangeListener() {

          public void propertyChange(PropertyChangeEvent pe) {
            String name = pe.getPropertyName();
            if (name.equals("ok") || name.equals("cancel")) {
              addModeAddHUDComponent.setVisible(false);
            }
          }
        };

    addHUDPanel.addPropertyChangeListener(plistener);
    addModeAddHUDComponent.setVisible(true);
  }
 public HUDComponent open(HUD hud) {
   return hud.createComponent(this);
 }
 public HUDComponent open(HUD hud) {
   hudComponent = hud.createComponent(this);
   hudComponent.setPreferredLocation(Layout.EAST);
   hudComponent.setTransparency(1.0f);
   return hudComponent;
 }