示例#1
0
  private void actionButtonActionPerformed() {
    if (userMode) {
      addUserPanel.inviteUsers();
    } else {
      /*
       * Phone Mode
       */
      String name = addPhoneUserPanel.getPhoneName();

      PresenceInfo[] info = pm.getAllUsers();

      for (int i = 0; i < info.length; i++) {
        if (info[i].getUsernameAlias().equals(name)
            || info[i].getUserID().getUsername().equals(name)) {

          addPhoneUserPanel.setStatusMessage(BUNDLE.getString("Name_Used"));
          return;
        }
      }

      addUserPanel.callUser(name, addPhoneUserPanel.getPhoneNumber());

      if (mode.equals(Mode.ADD)) {
        addHUDComponent.setVisible(false);
        addHUDComponent.setClosed();
      }
    }

    if (mode.equals(Mode.INITIATE)) {
      setMode(Mode.IN_PROGRESS);
    }
  }
示例#2
0
  private void leave() {
    session.send(client, new VoiceChatLeaveMessage(group, myPresenceInfo, client.getCOSName()));
    addHUDComponent.setVisible(false);
    addHUDPanelList.remove(this);

    if (addModeAddHUDComponent != null) {
      addModeAddHUDComponent.setVisible(false);
    }

    CallAnimator.stopCallAnswerAnimation(client);
  }
示例#3
0
  public void setPreferredLocation(Layout location) {
    if (addHUDPanelList.size() == 1) {
      addHUDComponent.setPreferredLocation(location);
      return;
    }

    setLocation(0, 0);
  }
示例#4
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);
  }
示例#5
0
 private void clearPanel() {
   Component[] components = getComponents();
   for (int c = 0; c < components.length; c++) {
     components[c].setVisible(false);
   }
   validate();
   if ((normalHeight > 0) && (addHUDComponent != null)) {
     // restore dialog to the normal height if was in HOLD mode
     addHUDComponent.setHeight(normalHeight);
   }
 }
示例#6
0
  @Override
  public void setLocation(int x, int y) {
    for (AddHUDPanel addHUDPanel : addHUDPanelList) {
      if (addHUDPanel == this) {
        continue;
      }

      HUDComponent hudComponent = addHUDPanel.getHUDComponent();

      Point p = hudComponent.getLocation();

      // System.out.println("x " + x + " y " + y + " Location " + p + " width " +
      // addHUDComponent.getWidth());

      if (p.getX() >= x) {
        x = (int) (p.getX() + hudComponent.getWidth());
        y = (int) p.getY();
      }
    }

    addHUDComponent.setLocation(x, y);
  }
示例#7
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();
            }
          }
        });
  }
示例#8
0
  private void showHoldPanel(boolean showPanel) {
    if (holdPanel == null) {
      holdPanel = new HoldPanel();

      holdPanel.addHoldListener(
          new ActionListener() {

            public void actionPerformed(ActionEvent e) {
              takeOffHold();
            }
          });

      holdPanel.addVolumeChangeListener(
          new ChangeListener() {

            public void stateChanged(javax.swing.event.ChangeEvent evt) {
              javax.swing.JSpinner holdVolumeSpinner = (javax.swing.JSpinner) evt.getSource();

              setHoldVolume((Float) holdVolumeSpinner.getValue());
            }
          });
    }

    holdPanel.setVisible(showPanel);

    if (showPanel) {
      add(holdPanel, BorderLayout.NORTH);
      if (normalHeight == 0) {
        normalHeight = addHUDComponent.getHeight();
      }
      /*
       * FIX ME:  setting the height confuses the mouse listener
       * and clicking on the Take Off Hold button doesn't work.
       */
      // addHUDComponent.setHeight(holdPanel.getPreferredSize().height);
    }
  }
示例#9
0
 public void setTitleOfViewWindow(String title) {
   if (userListHUDComponent != null) {
     userListHUDComponent.setName(title);
   }
 }
 public HUDComponent open(HUD hud) {
   hudComponent = hud.createComponent(this);
   hudComponent.setPreferredLocation(Layout.EAST);
   hudComponent.setTransparency(1.0f);
   return hudComponent;
 }
示例#11
0
 private void cancelButtonActionPerformed(ActionEvent e) {
   addHUDComponent.setVisible(false);
 }
示例#12
0
 public void setClosed() {
   addHUDComponent.setClosed();
 }