Examples of stringExtent()


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

      if (item.getText() != null && !item.getText().isEmpty()) {
        if (item.getImage() != null) {
          extent += textSpaceBefore;
        }
       
        extent += gc.stringExtent(item.getText()).x;
      }
     
      if ((item.getImage() != null) || (item.getText() != null && !item.getText().isEmpty())) {
        extent += closeButtonSpaceBefore;
      }
View Full Code Here

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

        Rectangle imageBounds = destItem.getImage().getBounds();
        bounds.height = Math.max(bounds.height, imageBounds.height);
      }
     
      if (destItem.getText() != null && !destItem.getText().isEmpty()) {
        Point textSize = gc.stringExtent(destItem.getText());
        bounds.height = Math.max(bounds.height, textSize.y);
      }
     
      Image closeButtonImage = UIImageResource.T.closeNormal10();
      Rectangle closeButtonImageBounds = closeButtonImage.getBounds();
View Full Code Here

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

        extent += imageBounds.width;
        extent += SPACING;
      }
     
      if (destItem.getText() != null && !destItem.getText().isEmpty()) {
        Point textSize = gc.stringExtent(destItem.getText());
        extent += textSize.x;
        extent += SPACING;
      }
     
      Image closeButtonImage = UIImageResource.T.closeNormal10();
View Full Code Here

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

    bounds.width = 0;
    bounds.height = 0;
   
    if (srcItem.getText() != null && !srcItem.getText().isEmpty()) {
      GC gc = new GC(this);
      Point textSize = gc.stringExtent(srcItem.getText());
      bounds.x += SPACING;
      bounds.y -= textSize.y / 2;
      bounds.width = textSize.x;
      bounds.height = textSize.y;
      gc.dispose();
View Full Code Here

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

        Rectangle imageBounds = srcItem.getImage().getBounds();
        bounds.height = Math.max(bounds.height, imageBounds.height);
      }
     
      if (srcItem.getText() != null && !srcItem.getText().isEmpty()) {
        Point textSize = gc.stringExtent(srcItem.getText());
        bounds.height = Math.max(bounds.height, textSize.y);
      }
     
      bounds.height = Math.max(bounds.height, closeButtonImageBounds.height);
    }
View Full Code Here

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

        extent += imageBounds.width;
        extent += SPACING;
      }
     
      if (srcItem.getText() != null && !srcItem.getText().isEmpty()) {
        Point textSize = gc.stringExtent(srcItem.getText());
        extent += textSize.x;
        extent += SPACING;
      }
     
      extent += closeButtonImageBounds.width;
View Full Code Here

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

    bounds.width = 0;
    bounds.height = 0;

    if (item.getText() != null && !item.getText().isEmpty()) {
      GC gc = new GC(this);
      Point textSize = gc.stringExtent(item.getText());
      bounds.x += SPACING;
      bounds.y -= textSize.y / 2;
      bounds.width = textSize.x;
      bounds.height = textSize.y;
      gc.dispose();
View Full Code Here

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

    Point size = new Point(0, 0);
   
    if (hasItemText(item)) {
      String text = item.getText();
      GC gc = new GC(this);
      size = gc.stringExtent(text);
      gc.dispose();
    }
   
    return size;
  }
View Full Code Here

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

  Point getTextSize() {
    Point size = new Point(0, 0);
   
    if (hasText()) {
      GC gc = new GC(parent);
      size = gc.stringExtent(getText());
      gc.dispose();
    }
   
    return size;
  }
View Full Code Here

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

    Point size = new Point(0, 0);
   
    if (hasText()) {
      String text = getText();
      GC gc = new GC(parent);
      size = gc.stringExtent(text);
      gc.dispose();
    }
   
    return size;
  }
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.