Esempio n. 1
0
  /**
   * Returns whether the given <code>AvatarWidget</code> is fully visible in the view port of the
   * viewer
   */
  public boolean isFullyVisible(AvatarWidget avatarWidget) {
    if (null != avatarWidget
        && null != avatarWidget.getControl()
        && false == avatarWidget.getControl().isDisposed()) {

      Rectangle controlBounds = avatarWidget.getControl().getBounds();
      if (controlBounds.x + controlBounds.width
          < avatarsPanel.getBounds().width - avatarsPanel.getBounds().x) {
        return true;
      }
    }
    return false;
  }
Esempio n. 2
0
  private AvatarWidget createBuddyControls(Composite composite, final VuzeBuddySWT vuzeBuddy) {
    AvatarWidget avatarWidget =
        new AvatarWidget(this, avatarSize, avatarImageSize, avatarNameSize, vuzeBuddy);
    avatarWidget.setBorderWidth(avatarHightLightBorder);
    avatarWidget.setTextColor(textColor);
    avatarWidget.setSelectedTextColor(selectedTextColor);
    avatarWidget.setTextLinkColor(textLinkColor);
    avatarWidget.setImageBorderColor(imageBorderColor);
    avatarWidget.setImageBorder(avatarImageBorder);
    avatarWidget.setSelectedColor(selectedColor);
    avatarWidget.setHighlightedColor(highlightedColor);

    /* UNCOMMENT THIS SECTION TO REVERT TO A ROW LAYOUT*/
    //		RowData rData = new RowData();
    //		rData.width = avatarSize.x;
    //		rData.height = avatarSize.y;
    //		avatarWidget.getControl().setLayoutData(rData);

    // COMMENT THIS SECTION TO REVERT TO A ROW LAYOUT
    SimpleReorderableListLayoutData rData = new SimpleReorderableListLayoutData();
    rData.width = avatarSize.x;
    rData.height = avatarSize.y;
    rData.position = (int) VuzeBuddyManager.getBuddyPosition(vuzeBuddy);
    avatarWidget.getControl().setLayoutData(rData);

    avatarWidgets.add(avatarWidget);

    chat.checkBuddy(vuzeBuddy);

    return avatarWidget;
  }