Exemplo n.º 1
0
 private JLabel header(String buyAndAddPremiumAccount_layoutDialogContent_get) {
   JLabel ret = SwingUtils.toBold(new JLabel(buyAndAddPremiumAccount_layoutDialogContent_get));
   ret.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, ret.getForeground()));
   return ret;
 }
Exemplo n.º 2
0
  public EndCaptchaTooltip(ServicePanel owner, final EndCaptchaSolver solver) {

    super(new TooltipPanel("ins 0,wrap 1", "[grow,fill]", "[grow,fill]"));
    this.owner = owner;
    color = (LAFOptions.getInstance().getColorForTooltipForeground());
    JProgressBar progress = new JProgressBar();
    progress.setIndeterminate(true);
    panel.setLayout(new MigLayout("ins 0,wrap 1", "[grow,fill]", "[]"));
    JLabel header =
        new JLabel("EndCaptcha.com Solver", new AbstractIcon("endCaptcha", 18), JLabel.LEFT);
    header.setBorder(
        BorderFactory.createMatteBorder(
            0, 0, 1, 0, LAFOptions.getInstance().getColorForTooltipForeground()));
    SwingUtils.toBold(header);
    header.setForeground(LAFOptions.getInstance().getColorForTooltipForeground());
    panel.add(header, "gapbottom 5,spanx");
    panel.add(progress);
    // panel.setPreferredSize(new Dimension(300, 100));
    new Thread() {
      public void run() {

        final EndCaptchaAccount account = solver.loadAccount();
        new EDTRunner() {

          @Override
          protected void runInEDT() {
            panel.removeAll();
            // panel.setPreferredSize(null);
            if (!account.isValid()) {
              panel.setLayout(new MigLayout("ins 0,wrap 1", "[grow,fill]", "[]"));
              JLabel header =
                  new JLabel(
                      "EndCaptcha.com Solver", new AbstractIcon("endCaptcha", 18), JLabel.LEFT);
              header.setBorder(
                  BorderFactory.createMatteBorder(
                      0, 0, 1, 0, LAFOptions.getInstance().getColorForTooltipForeground()));
              SwingUtils.toBold(header);
              header.setForeground(LAFOptions.getInstance().getColorForTooltipForeground());
              panel.add(header, "gapbottom 5,spanx");
              panel.add(
                  lbl(
                      _GUI.T.ServicePanel9kwTooltip_runInEDT_error2(""),
                      NewTheme.I().getIcon(IconKey.ICON_ERROR, 18),
                      JLabel.LEFT));
              panel.add(lbl(account.getError()), "gapleft 22");
            } else {
              panel.setLayout(new MigLayout("ins 0,wrap 2", "[][grow,align right]", "[]0"));
              JLabel header =
                  new JLabel(
                      "EndCaptcha.com Solver", new AbstractIcon("endCaptcha", 18), JLabel.LEFT);
              header.setBorder(
                  BorderFactory.createMatteBorder(
                      0, 0, 1, 0, LAFOptions.getInstance().getColorForTooltipForeground()));
              SwingUtils.toBold(header);
              header.setForeground(LAFOptions.getInstance().getColorForTooltipForeground());
              panel.add(header, "spanx,gapbottom 5,pushx,growx");

              panel.add(
                  lbl(
                      _GUI.T.lit_accountid(),
                      NewTheme.I().getIcon(IconKey.ICON_PREMIUM, 18),
                      JLabel.LEFT));
              panel.add(lbl(account.getUserName() + ""));
              panel.add(
                  lbl(
                      _GUI.T.ServicePanel9kwTooltip_runInEDT_credits_(),
                      NewTheme.I().getIcon(IconKey.ICON_MONEY, 18),
                      JLabel.LEFT));
              panel.add(lbl(account.getBalance() + " USD"));

              // panel.add(lbl(_GUI.T.lit_rate(), NewTheme.I().getIcon(IconKey.ICON_PLAY, 18),
              // JLabel.LEFT));
              // panel.add(lbl(account.getRate() + " USD Cent/Captcha"));
              // panel.add(lbl(_GUI.T.ServicePanelDBCTooltip_captcha_free(),
              // NewTheme.I().getIcon(IconKey.ICON_OCR, 18),
              // JLabel.LEFT));
              // panel.add(lbl((int) (account.getBalance() / account.getRate())));
              // if (account.isBanned()) {
              // panel.add(lbl(_GUI.T.ServicePanel9kwTooltip_runInEDT_banned(),
              // NewTheme.I().getIcon(IconKey.ICON_ERROR, 18),
              // JLabel.LEFT));
              //
              // }

            }
            // panel.revalidate();
            // revalidate();
            // repaint();
            ToolTipController.getInstance().show(EndCaptchaTooltip.this);
          }
        };
      }
    }.start();
  }