Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Rectangle


    return setHeight(height);
  }

  // @see org.gudy.azureus2.ui.swt.views.table.TableRowSWT#getBounds()
  public Rectangle getBounds() {
    Rectangle bounds = getBounds(1);
    if (bounds == null) {
      return new Rectangle(0, 0, 0, 0);
    }
    bounds.x = 0;
    bounds.width = table.getSize().x;
    return bounds;
  }
View Full Code Here


 
  /** Calculate the bounds of the receiver should be drawing in
    * @return what size/position the canvas should be
    */
  public Rectangle getBoundsForCanvas() {
    Rectangle bounds = super.getBounds();
    if(bounds == null)
      return null;
    bounds.y += marginHeight;
    bounds.height -= (marginHeight * 2);
    bounds.x += marginWidth;
View Full Code Here

  public Rectangle getBoundsRaw() {
    return super.getBounds();
  }

  public Point getSize() {
    Rectangle bounds = super.getBounds();
    if(bounds == null)
      return new Point(0, 0);
    return new Point(bounds.width - (marginWidth * 2),
                     bounds.height - (marginHeight * 2));
  }
View Full Code Here

  }
 
  public Image getBackgroundImage() {
    Image imageRowBG = row.getBackgroundImage();
    if (imageRowBG != null) {
      Rectangle bounds = super.getBounds();
     
      int wInside = bounds.width - (marginWidth * 2);
      int hInside = bounds.height - (marginHeight * 2);
      Image imageCellBG = new Image(Display.getDefault(), wInside, hInside);
      GC gc = new GC(imageCellBG);
      gc.drawImage(imageRowBG, bounds.x + marginWidth, 0 + marginHeight,
          wInside, hInside, 0, 0, wInside, hInside);
      gc.dispose();
     
      return imageCellBG;
    }
   
    TableOrTreeSWT table = row.getTable();
   
    Rectangle bounds = super.getBounds();
   
    if (bounds.isEmpty()) {
      return null;
    }
   
    Image image = new Image(Display.getDefault(), bounds.width
        - (marginWidth * 2), bounds.height - (marginHeight * 2));
 
View Full Code Here

        schemaSectionItemNew.setText("new");
        schemaSectionItemNew.setImage(Plugin.getDefault().getImageRegistry().get(Plugin.IMAGE_SCHEMADEFINITION_ADD));
        schemaSectionItemNew.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event event) {

                  Rectangle rect = schemaSectionItemNew.getBounds();
                  Point pt = new Point(rect.x, rect.y + rect.height);
                  pt = schemaSectionToolBar.toDisplay(pt);
                  menu.setLocation(pt.x, pt.y);
                  menu.setVisible(true);
View Full Code Here

                int  item_index = 0;
               
                for (int i=0;i<headers.length;i++){
                 
                  Rectangle bounds = item.getBounds(i);
                 
                  if ( bounds.contains( mouse_position )){
                   
                    item_index = i;
                   
                    break;
                  }
                }
               
                if( item_index != 0 ){
                 
                  return;
                }
               
                tip = new Shell(buddy_table.getShell(), SWT.ON_TOP | SWT.TOOL);
                tip.setLayout(new FillLayout());
                label = new Label(tip, SWT.NONE);
                label.setForeground(buddy_table.getDisplay()
                    .getSystemColor(SWT.COLOR_INFO_FOREGROUND));
                label.setBackground(buddy_table.getDisplay()
                    .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
                label.setData("_TABLEITEM", item);
               
                label.setText( getToolTip( buddy ));
               
                label.addListener(SWT.MouseExit, tt_label_listener);
                label.addListener(SWT.MouseDown, tt_label_listener);
                Point size = tip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
                Rectangle rect = item.getBounds(item_index);
                Point pt = buddy_table.toDisplay(rect.x, rect.y);
                tip.setBounds(pt.x, pt.y, size.x, size.y);
                tip.setVisible(true);
              }
            }
View Full Code Here

              return;
            }
            Shell anyShell = Utils.findAnyShell();
            Point location = null;
            if (anyShell != null) {
              Rectangle bounds = anyShell.getBounds();
              location = new Point(bounds.x, bounds.y);
            }
            Shell[] shells = instance.getDisplay().getShells();
            for (Shell shell : shells) {
              if (!shell.isDisposed()) {
View Full Code Here

          if (strings.length > 2) {
            try {
              int w = Integer.parseInt(strings[1]);
              int h = Integer.parseInt(strings[2]);

              Rectangle computeTrim = shell.computeTrim(0, 0, w, h);
              shell.setSize(computeTrim.width, computeTrim.height);
            } catch (Exception e) {
            }
          }
        }
View Full Code Here

    }
  
    boolean scaleChanged = lastMax != scale.getMax();
   
    if(sizeChanged || scaleChanged || bufferScale == null) {
      Rectangle bounds = drawCanvas.getClientArea();
      if(bounds.height < 30 || bounds.width  < 100)
        return;     
     
      if(bufferScale != null && ! bufferScale.isDisposed())
        bufferScale.dispose();
View Full Code Here

 
  public void refresh() { 
    if(drawCanvas == null || drawCanvas.isDisposed())
      return;
   
    Rectangle bounds = drawCanvas.getClientArea();
    if(bounds.height < 30 || bounds.width  < 100 || bounds.width > 2000 || bounds.height > 2000)
      return;
   
    boolean sizeChanged = (oldSize == null || oldSize.x != bounds.width || oldSize.y != bounds.height);
    oldSize = new Point(bounds.width,bounds.height);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Rectangle

Copyright © 2018 www.massapicom. 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.