/**
  * Update the progress text.
  *
  * @param text the new progress text, or null to clear.
  */
 public void setProgressText(@Nullable final String text) {
   if (text == null || text.trim().length() == 0) {
     progressLabel.setText(" ");
   } else {
     progressLabel.setText(text);
   }
   progressLabel.validate();
 }
예제 #2
0
 protected JLabel createTitleLabel(int preferredWidth) {
   JLabel result = new JLabel(getTitle());
   result.setHorizontalAlignment(SwingConstants.CENTER);
   if (getIcon() != null) {
     result.setIcon(getIcon());
     result.setIconTextGap(10);
   }
   result.setBackground(titleBgColor);
   result.setForeground(titleForeColor);
   result.setOpaque(true);
   result.setBorder(titleBorder);
   result.validate();
   Dimension d = result.getPreferredSize();
   result.setPreferredSize(new Dimension(Math.max(d.width, preferredWidth), d.height));
   result.setMinimumSize(result.getPreferredSize());
   return result;
 }
예제 #3
0
  private void handleVCardInformation(VCard vcard, String phoneNumber) {
    if (vcard.getError() != null) {
      return;
    }

    String firstName = vcard.getFirstName();
    String lastName = vcard.getLastName();
    if (ModelUtil.hasLength(firstName) && ModelUtil.hasLength(lastName)) {
      titleLabel.setText(firstName + " " + lastName);
    } else if (ModelUtil.hasLength(firstName)) {
      titleLabel.setText(firstName);
    }

    phoneLabel.setText(phoneNumber);

    String jobTitle = vcard.getField("TITLE");
    if (jobTitle != null) {
      professionLabel.setText(jobTitle);
    }

    byte[] avatarBytes = null;
    try {
      avatarBytes = vcard.getAvatar();
    } catch (Exception e) {
      Log.error("Cannot retrieve avatar bytes.", e);
    }

    if (avatarBytes != null) {
      try {
        ImageIcon avatarIcon = new ImageIcon(avatarBytes);
        avatarLabel.setIcon(avatarIcon);
        avatarLabel.invalidate();
        avatarLabel.validate();
        avatarLabel.repaint();
      } catch (Exception e) {
        // no issue
      }
    }

    invalidate();
    validate();
    repaint();
  }
예제 #4
0
 public ReportTreeListener() {
   dragIcon.validate();
   dragIcon.setVisible(true);
 }
예제 #5
0
 /** Constructor for the JMeterTreeListener object. */
 public ReportTreeListener(ReportTreeModel model) {
   this.model = model;
   dragIcon.validate();
   dragIcon.setVisible(true);
 }