Package org.eclipse.swt.graphics

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


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


        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);
      }

      Image closeButtonImage = UIImageResource.T.closeNormal10();
      Rectangle closeButtonImageBounds = closeButtonImage.getBounds();
View Full Code Here

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

    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

        }

        if (itemController.getItem().getText() != null
            && !itemController.getItem().getText().isEmpty()) {
          size.y = Math
              .max(size.y, gc.stringExtent(itemController
                  .getItem().getText()).y);
        }

        size.y = Math.max(size.y, UIImageResource.T
            .closeNormal10().getBounds().height);
View Full Code Here

      if (item.getText() != null && !item.getText().isEmpty()) {
        if (item.getImage() != null) {
          size.x += itemTextExtraSpaceBefore;
        }

        size.x += gc.stringExtent(item.getText()).x;
      }

      if ((item.getImage() != null)
          || (item.getText() != null && !item.getText().isEmpty())) {
        size.x += itemCloseButtonExtraSpaceBefore;
View Full Code Here

        bounds.x += itemTextExtraSpaceBefore;
      }

      GC gc = new GC(this);
      {
        Point textSize = gc.stringExtent(item.getText());
        bounds.y -= textSize.y / 2;
        bounds.width = textSize.x;
        bounds.height = textSize.y;
      }
      gc.dispose();
View Full Code Here

  public 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

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

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