Package util.ui

Examples of util.ui.TextAreaIcon


        if (width <= 0) {
          width = Settings.propColumnWidth.getInt();
        }

        TextAreaIcon icon = new TextAreaIcon(HTMLTextHelper.convertHtmlToText(item.getDescription()), new JLabel().getFont(), width, 2);

        JLabel iconLabel = new JLabel("");
        iconLabel.setIcon(icon);

        pb.add(iconLabel, cc.xyw(2,4,3));

        JLabel label3 = new JLabel();

        if (item.isAlreadyInstalled()) {
          Version installedVersion = item.getInstalledVersion();
          if ((installedVersion != null) && (installedVersion.compareTo(item.getVersion()) < 0)) {
            label.setIcon(NEW_VERSION_ICON);

            label3.setText("(" + mLocalizer.msg("installed","Installed version: ") + installedVersion.toString()+")");
            label3.setFont(label3.getFont().deriveFont(label3.getFont().getSize2D()+2));

            pb.add(label3, cc.xy(4,2));
          }
        }

        if (isSelected && isEnabled) {
          label.setForeground(list.getSelectionForeground());

          String author = item.getProperty("author");
          String website = item.getWebsite();

          FormLayout authorAndWebsiteLayout = new FormLayout("default,5dlu,default","default");
          JPanel authorAndWebsite = new JPanel(authorAndWebsiteLayout);
          authorAndWebsite.setOpaque(false);

          if (author != null) {
            lay.appendRow(RowSpec.decode("2dlu"));
            lay.appendRow(RowSpec.decode("default"));
            lay.appendRow(RowSpec.decode("2dlu"));

            pb.add(authorAndWebsite, cc.xyw(2,7,3));

            JLabel authorLabel = new JLabel(mLocalizer.msg("author", "Author"));
            authorLabel.setFont(authorLabel.getFont().deriveFont(Font.BOLD));
            authorLabel.setForeground(list.getSelectionForeground());
            authorLabel.setHorizontalAlignment(SwingConstants.RIGHT);

            JLabel authorName = new JLabel(HTMLTextHelper.convertHtmlToText(author));
            authorName.setForeground(list.getSelectionForeground());

            authorAndWebsite.add(authorLabel, cc.xy(1,1));
            authorAndWebsite.add(authorName, cc.xy(3,1));
          }

          if (website != null) {
            if(author == null) {
              lay.appendRow(RowSpec.decode("2dlu"));
              lay.appendRow(RowSpec.decode("default"));
              lay.appendRow(RowSpec.decode("2dlu"));

              pb.add(authorAndWebsite, cc.xyw(2,7,3));
            }
            else {
              authorAndWebsiteLayout.appendRow(RowSpec.decode("1dlu"));
              authorAndWebsiteLayout.appendRow(RowSpec.decode("default"));
            }

            JLabel webLabel = new JLabel(mLocalizer.msg("website", "Website"));
            webLabel.setFont(webLabel.getFont().deriveFont(Font.BOLD));
            webLabel.setForeground(list.getSelectionForeground());
            webLabel.setHorizontalAlignment(SwingConstants.RIGHT);

            LinkButton webLink = new LinkButton(HTMLTextHelper.convertHtmlToText(website));
            webLink.setForeground(list.getSelectionForeground());

            authorAndWebsite.add(webLabel, cc.xy(1,author == null ? 1 : 3));
            authorAndWebsite.add(webLink, cc.xy(3,author == null ? 1 : 3));
          }

          icon.setMaximumLineCount(-1);
          iconLabel.setForeground(list.getSelectionForeground());

          label3.setForeground(list.getSelectionForeground());
        } else {
          if(!item.isStable()) {
            label.setForeground(new Color(200, 0, 0));
          }
          else {
            label.setForeground(list.getForeground());
          }

          icon.setMaximumLineCount(1);
          iconLabel.setForeground(list.getSelectionForeground());
          iconLabel.setForeground(list.getForeground());
          label3.setForeground(Color.gray);
        }
View Full Code Here


      mShowStartTime = true;
      mShowDate = false;
      mShowName = true;
    }
       
    mChannelName = new TextAreaIcon(p.getChannel().getName(), mBoldFont, Settings.propTrayChannelWidth.getInt());
    mChannelName.setMaximumLineCount(2);

    if(mShowToolTip) {
      ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
     
View Full Code Here

      titleWidth-=mChannelIcon.getIconWidth();
    }



    mTitleIcon = new TextAreaIcon(null, mSettings.getTitleFont(), titleWidth);
    int timefieldWidth = mSettings.getTimeFieldWidth();
    mDescriptionIcon = new TextAreaIcon(null,mSettings.getTextFont(), width - timefieldWidth - 5 + timefieldWidth/2);
    mDescriptionIcon.setMaximumLineCount(3);

    if (showEndTime) {
      mEndTimeIcon = new TextAreaIcon(createTimeString(prog.getMinutes()+prog.getHours()*60+prog.getLength()), mSettings.getTextFont().deriveFont(Font.ITALIC), mDescriptionIcon.getIconWidth());
    }


    setProgram(prog, -1);
  }
View Full Code Here

    if (canAdd) {
      int x = mWidth/mNumOfCols * mCurColumnInx;
      if (spaceForDatestring > 0) {
        mCurY += spaceForDatestring;
        mPrograms.add(new DateItem(new TextAreaIcon(mCurDate.getLongDateString(), mDateFont, mWidth/mNumOfCols), x, mCurY));
        mCurY += mDateFont.getSize()*1.3;
      }
      mPrograms.add(item);
      item.setPos(x, mCurY);
      mCurY = mCurY + item.getHeight() + mProgramIconSettings.getTitleFont().getSize()/3;
View Full Code Here

TOP

Related Classes of util.ui.TextAreaIcon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.