Пример #1
0
  public void setHUDComponent(HUDComponent addHUDComponent) {
    this.addHUDComponent = addHUDComponent;

    addHUDComponent.addEventListener(
        new HUDEventListener() {

          public void HUDObjectChanged(HUDEvent e) {
            // System.out.println("GOT EVENT " + e);

            if (mode.equals(Mode.IN_PROGRESS) && e.getEventType().equals(HUDEventType.CLOSED)) {
              leave();
            }
          }
        });
  }
Пример #2
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);
  }