コード例 #1
0
ファイル: MetaUIContact.java プロジェクト: richardwhiuk/jitsi
  /**
   * Adds resources for contact.
   *
   * @param tip the tool tip
   * @param protocolContact the protocol contact, which resources we're looking for
   */
  private void addContactResourceTooltipLines(ExtendedTooltip tip, Contact protocolContact) {
    Collection<ContactResource> contactResources = protocolContact.getResources();

    if (contactResources == null) return;

    Iterator<ContactResource> resourcesIter = contactResources.iterator();

    while (resourcesIter.hasNext()) {
      ContactResource contactResource = resourcesIter.next();

      // We only add the status icon if we have more than one resources,
      // otherwise it will always be identical to the contact status icon.
      ImageIcon protocolStatusIcon = null;
      if (contactResources.size() > 1) {
        protocolStatusIcon =
            ImageLoader.getIndexedProtocolIcon(
                ImageUtils.getBytesInImage(contactResource.getPresenceStatus().getStatusIcon()),
                protocolContact.getProtocolProvider());
      }

      String resourceName =
          (contactResource.getPriority() >= 0)
              ? contactResource.getResourceName() + " (" + contactResource.getPriority() + ")"
              : contactResource.getResourceName();

      if (protocolStatusIcon == null) tip.addSubLine(protocolStatusIcon, resourceName, 27);
      else tip.addSubLine(protocolStatusIcon, resourceName, 20);
    }

    tip.revalidate();
    tip.repaint();
  }
コード例 #2
0
ファイル: MetaUIContact.java プロジェクト: richardwhiuk/jitsi
  /**
   * Fills the tooltip with details.
   *
   * @param tip the tooltip to fill
   * @param phones the available phone details.
   */
  private void addPhoneTooltipLines(ExtendedTooltip tip, Iterator<String> phones) {
    while (phones.hasNext()) {
      tip.addSubLine(null, phones.next(), 27);
    }

    tip.revalidate();
    tip.repaint();
  }