Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.stringExtent()


        int height = 0;

        TableItem[] tableItems = table.getItems();

        GC gc = new GC(text);
        int spacer = gc.stringExtent(" ").x; //$NON-NLS-1$
        int textWidth = gc.stringExtent(text.getText()).x;
        int colIndex = getDisplayColumnIndex();

        // calculate the maximum text width.
        for (int i = 0; i < tableItems.length; i++) {
View Full Code Here


        TableItem[] tableItems = table.getItems();

        GC gc = new GC(text);
        int spacer = gc.stringExtent(" ").x; //$NON-NLS-1$
        int textWidth = gc.stringExtent(text.getText()).x;
        int colIndex = getDisplayColumnIndex();

        // calculate the maximum text width.
        for (int i = 0; i < tableItems.length; i++) {
            textWidth = Math.max(gc.stringExtent(tableItems[i].getText(colIndex)).x, textWidth);
View Full Code Here

        int textWidth = gc.stringExtent(text.getText()).x;
        int colIndex = getDisplayColumnIndex();

        // calculate the maximum text width.
        for (int i = 0; i < tableItems.length; i++) {
            textWidth = Math.max(gc.stringExtent(tableItems[i].getText(colIndex)).x, textWidth);
        }
        gc.dispose();
        Point textSize = text.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
        Point arrowSize = arrow.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
        Point tableSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
View Full Code Here

    commitId.setText(UIText.CommitGraphTable_CommitId);
    int minWidth;
    GC gc = new GC(rawTable.getDisplay());
    try {
      gc.setFont(rawTable.getFont());
      minWidth = gc.stringExtent("0000000").x + 5; //$NON-NLS-1$
    } finally {
      gc.dispose();
    }
    layout.addColumnData(new ColumnWeightData(1, minWidth, true));
View Full Code Here

      fIndentation= new int[fCachedNumberOfDigits + 1];

      char[] nines= new char[fCachedNumberOfDigits];
      Arrays.fill(nines, '9');
      String nineString= new String(nines);
      Point p= gc.stringExtent(nineString);
      fIndentation[0]= p.x;

      for (int i= 1; i <= fCachedNumberOfDigits; i++) {
        p= gc.stringExtent(nineString.substring(0, i));
        fIndentation[i]= fIndentation[0] - p.x;
View Full Code Here

      String nineString= new String(nines);
      Point p= gc.stringExtent(nineString);
      fIndentation[0]= p.x;

      for (int i= 1; i <= fCachedNumberOfDigits; i++) {
        p= gc.stringExtent(nineString.substring(0, i));
        fIndentation[i]= fIndentation[0] - p.x;
      }

    } finally {
      gc.dispose();
View Full Code Here

        Rectangle bounds= im.getBounds();

        GC g= new GC(im);

        Point ee= g.stringExtent(this.fTitle);
        int titleHeight= ee.y;

        double maxItem= getMaxItem();
        double minItem= getMinItem();
View Full Code Here

        int max= (int) (Math.ceil(maxItem * (maxItem < 0 ? 0.9 : 1.2)));
        int min= (int) (Math.floor(minItem * (minItem < 0 ? 1.2 : 0.9)));

        String smin= this.fDimension.getDisplayValue(min);
        Point emin= g.stringExtent(smin);

        String smax= this.fDimension.getDisplayValue(max);
        Point emax= g.stringExtent(smax);

        int labelWidth= Math.max(emin.x, emax.x) + 2;
View Full Code Here

        String smin= this.fDimension.getDisplayValue(min);
        Point emin= g.stringExtent(smin);

        String smax= this.fDimension.getDisplayValue(max);
        Point emax= g.stringExtent(smax);

        int labelWidth= Math.max(emin.x, emax.x) + 2;

        int top= PADDING;
        int bottom= bounds.height - titleHeight - PADDING;
View Full Code Here

        Rectangle bounds= im.getBounds();

        GC g= new GC(im);

        Point ee= g.stringExtent(this.fTitle);
        int titleHeight= ee.y;

        double maxItem= getMaxItem();
        double minItem= getMinItem();
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.