Examples of calculateMetrics()


Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

      if (image != null && !image.isDisposed()) {
        imageBounds = image.getBounds();
      }
      GCStringPrinter sp = new GCStringPrinter(e.gc, getText(), clientArea,
          true, true, SWT.CENTER);
      sp.calculateMetrics();
      Point textSize = sp.getCalculatedSize();

      if (imageBounds != null) {
        int pad = 2;
        int ofs = imageBounds.width + imageBounds.x;
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

      }

      GC gc = new GC(this);
      GCStringPrinter sp = new GCStringPrinter(gc, getText(), new Rectangle(0,
          0, 10000, 20), true, true, SWT.LEFT);
      sp.calculateMetrics();
      Point lastTextSize = sp.getCalculatedSize();
      gc.dispose();

      lastSize.x += lastTextSize.x + 10;
      lastSize.y = Math.max(lastSize.y, lastTextSize.y);
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

      int h = 15;

      String textAdd = MessageText.getString("Button.add");
      GCStringPrinter sp2 = new GCStringPrinter(gc, textAdd,
          new Rectangle(x, y, 500, h), true, false, SWT.CENTER);
      sp2.calculateMetrics();
      int w = sp2.getCalculatedSize().x + 12;
     
      gc.setAdvanced(true);
      gc.setAntialias(SWT.ON);
      gc.setBackground(ColorCache.getColor(gc.getDevice(), 255, 255, 255));
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

                  tableColumn.getTitleLanguageKey(), tableColumn.getName());
              String s = title
                  + " Column will be placed at the location you drop it, shifting other columns down";
              GCStringPrinter sp = new GCStringPrinter(gc, s, bounds, false, false,
                  SWT.CENTER | SWT.WRAP);
              sp.calculateMetrics();
              if (sp.isCutoff()) {
                GCStringPrinter.printString(gc, title, bounds, false, false,
                    SWT.CENTER | SWT.WRAP);
              } else {
                sp.printString();
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

        gc.setAlpha(alpha);

        GCStringPrinter sp = new GCStringPrinter(gc, sDisplayText,
            new Rectangle(0, 0, wHint == -1 ? 3000 : wHint, hHint == -1
                ? 3000 : hHint), true, false, style & SWT.WRAP);
        sp.calculateMetrics();
        pt = sp.getCalculatedSize();
        pt.x += border + hpadding * 2;
        pt.y += border + vpadding * 2;
        gc.dispose();

 
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

          int fullWidth = printArea.width;
          int fullHeight = printArea.height;
          GCStringPrinter sp = new GCStringPrinter(e.gc,
              MessageText.getString("remote.pairing.accesscode"), printArea,
              false, false, SWT.NONE);
          sp.calculateMetrics();
          Point sizeAccess = sp.getCalculatedSize();

          String drawAccessCode = accessCode == null ? "      " : accessCode;

          int numBoxes = drawAccessCode == null ? 0 : drawAccessCode.length();
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

      Rectangle bounds = getDrawBounds(cell);

      GCStringPrinter sp = new GCStringPrinter(gc, text, bounds, true, true,
          SWT.WRAP | SWT.CENTER);

      sp.calculateMetrics();

      if (sp.hasHitUrl()) {
        URLInfo[] hitUrlInfo = sp.getHitUrlInfo();
        for (int i = 0; i < hitUrlInfo.length; i++) {
          URLInfo info = hitUrlInfo[i];
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

        gc.setFont(font);
      }
      Rectangle drawBounds = getDrawBounds((TableCellSWT) event.cell);
      sp = new GCStringPrinter(gc, text, drawBounds, true, true, SWT.WRAP
          | SWT.CENTER);
      sp.calculateMetrics();
    } catch (Exception e) {
      Debug.out(e);
    } finally {
      gc.dispose();
    }
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.shells.GCStringPrinter.calculateMetrics()

    int style = (drawBounds.height < 40) ? 0 : SWT.WRAP;

    GCStringPrinter sp = new GCStringPrinter(gc, text, drawBounds, true, true,
        style);

    sp.calculateMetrics();

    return sp;
  }

  // @see org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener#refresh(org.gudy.azureus2.plugins.ui.tables.TableCell)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.