Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Rectangle


   try{
       this_mon.enter();
      
      drawScale(sizeChanged);
     
      Rectangle bounds = drawCanvas.getClientArea();   
       
      //If bufferedImage is not null, dispose it
      if(bufferImage != null && ! bufferImage.isDisposed())
        bufferImage.dispose();
     
View Full Code Here


  protected void drawBackGround(boolean sizeChanged) {   
    if(drawCanvas == null || drawCanvas.isDisposed())
      return;
   
    if(sizeChanged || bufferBackground == null) {            
      Rectangle bounds = drawCanvas.getClientArea();
      if(bounds.height < 30 || bounds.width  < 100)
        return;
     
      if(bufferBackground != null && ! bufferBackground.isDisposed())
        bufferBackground.dispose();
View Full Code Here

        if (event.image != null && !Constants.isLinux) {
          try {
            GC gc = new GC(event.image);
            try {
              Rectangle bounds = event.image.getBounds();
              gc.fillRectangle(bounds);
              String title = MessageText.getString(
                  tableColumn.getTitleLanguageKey(), tableColumn.getName());
              String s = title
                  + " Column will be placed at the location you drop it, shifting other columns down";
View Full Code Here

        return;
      }
      sampleCell = new FakeTableCell(column);

      sampleCell.setControl(tv.getTableComposite());
      Rectangle bounds = ((TableCellImpl)parentCell).getBounds();
      sampleCell.setCellArea(bounds);
      if (sampleRow != null) {
        sampleCell.setDataSource(((TableRowCore)sampleRow).getDataSource(true));
      }
    }
View Full Code Here

    // @see org.gudy.azureus2.ui.swt.views.table.TableCellSWTPaintListener#cellPaint(org.eclipse.swt.graphics.GC, org.gudy.azureus2.ui.swt.views.table.TableCellSWT)
    public void cellPaint(GC gc, TableCellSWT cell) {
      if (sampleCell == null) {
        return;
      }
      Rectangle bounds = ((TableCellImpl)cell).getBounds();
      sampleCell.setCellArea(bounds);
      try {
        sampleCell.doPaint(gc);
      } catch (Throwable e) {
        Debug.out(e);
View Full Code Here

          }
        }
      });

     
        Rectangle bounds = shell.getMonitor().getClientArea();   
        x0 = bounds.x + bounds.width - 255;
        x1 = bounds.x + bounds.width;
 
        y0 = bounds.y + bounds.height;
        y1 = bounds.y + bounds.height - 155;
View Full Code Here

    if ( canvas == null || canvas.isDisposed()){
     
      return;
    }
   
    Rectangle bounds = canvas.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);
View Full Code Here

    final double ANGLE_TAN = Math.tan( ANGLE_RADS );
   
    try{
      this_mon.enter();

      Rectangle bounds = canvas.getClientArea();   

      if ( bufferImage != null && ! bufferImage.isDisposed()){
       
        bufferImage.dispose();
      }
     
      bufferImage = new Image( canvas.getDisplay(), bounds );

      GC image = new GC( bufferImage );

      int  max_x = 0;
      int  max_y = 0;
      int  max_z = 0;
     
      for (int i=0;i<values.length;i++){
       
        int[]  entry = (int[])values[i];
       
        if ( entry[0] > max_x ){
         
          max_x = entry[0];
        }
        if ( entry[1] > max_y ){
         
          max_y = entry[1];
        }
        if ( entry[2] > max_z ){
       
          max_z = entry[2];
        }
      }
     
     
      int usable_width   = bounds.width - PAD_LEFT - PAD_RIGHT;
      int usable_height  = bounds.height - PAD_TOP - PAD_BOTTOM;
     
      try {
        image.setAntialias( SWT.ON );
      } catch (Exception e) {
        // Ignore ERROR_NO_GRAPHICS_LIBRARY error or any others
      }
     
      double  x_ratio = ((float)usable_width-((usable_height/2)/ANGLE_TAN)) / max_x;
      double  y_ratio = ((float)usable_height/2) / max_y;
      double  z_ratio = ((float)usable_height/2) / max_z;
     
        // grid
     
      int x_axis_left_x = PAD_LEFT;
      int x_axis_left_y = usable_height + PAD_TOP;
      int x_axis_right_x = PAD_LEFT + usable_width;
      int x_axis_right_y  = usable_height + PAD_TOP;
     

      int y_axis_left_x = PAD_LEFT;
      int y_axis_left_y = usable_height + PAD_TOP;     
      int y_axis_right_x = PAD_LEFT + (int)((usable_height/2) / ANGLE_TAN );
      int y_axis_right_y = usable_height / 2;
     
      int z_axis_bottom_x = PAD_LEFT;
      int z_axis_bottom_y = usable_height + PAD_TOP;
      int z_axis_top_x  = PAD_LEFT;
      int z_axis_top_y  = PAD_TOP + usable_height / 2;
     
      Rectangle old_clip = image.getClipping();

      image.setClipping( new Rectangle( PAD_LEFT, PAD_RIGHT, usable_width, usable_height ));
     
      image.setForeground( Colors.light_grey );

      int  x_lines = 10;
     
View Full Code Here

          size.y += toolTipShell.getBorderWidth() * 2 + (f.marginHeight * 2);
        } catch (NoSuchFieldError e) {
          /* Ignore for Pre 3.0 SWT.. */
        }
        Point pt = composite.toDisplay(event.x, event.y);
        Rectangle displayRect;
        try {
          displayRect = composite.getMonitor().getClientArea();
        } catch (NoSuchMethodError e) {
          displayRect = composite.getDisplay().getClientArea();
        }
View Full Code Here

        if (soContainer.getPropogation()) {
          Point pt = control.toDisplay(event.x, event.y);
          Composite composite = soContainer.getComposite();
          Point relPt = composite.toControl(pt);
          // mouse exit and enter happens on client area (not full widget area)
          Rectangle bounds = composite.getClientArea();
          if (bounds.contains(relPt)
              && composite.getDisplay().getActiveShell() != null) {
            if (skinObject != null && (DEBUG || skinObject.isDebug())) {
              System.out.println("skip " + skinObject
                  + " because going into child");
            }
            return;
          }
        }
      }

      if (isExit && control.getParent() != null) {
        // check if exiting and going into parent
        Composite parent = control.getParent();
        SWTSkinObject soParent = (SWTSkinObject) parent.getData("SkinObject");
        if (soParent != null && (soParent instanceof SWTSkinObjectContainer)) {
          SWTSkinObjectContainer container = (SWTSkinObjectContainer) soParent;
          if (container.getPropogation()) {
            Point pt = control.toDisplay(event.x, event.y);
            Point relPt = container.getComposite().toControl(pt);
            Rectangle bounds = parent.getClientArea();
            if (bounds.contains(relPt)
                && parent.getDisplay().getActiveShell() != null) {
              if (skinObject != null && (DEBUG || skinObject.isDebug())) {
                System.out.println("skip " + skinObject
                    + " because going into parent " + bounds + ";" + relPt + ";" + parent.getDisplay().getActiveShell());
              }
              // XXX Disabled for now as it doesn't always work
              //return;
            }
          }
        }
      }

      if (skinObject != null) {
        String sSuffix = (event.type == eventOn) ? suffix : "";
        if (skinObject != null && (DEBUG || skinObject.isDebug())) {
          System.out.println(System.currentTimeMillis() + ": " + skinObject
              + "--" + sSuffix);
        }
       
        Point ptMouse = control.toDisplay(0, 0);
        while (skinObject != null) {
          Rectangle bounds = skinObject.getControl().getBounds();
          Point pt = skinObject.getControl().toDisplay(0, 0);
          bounds.x = pt.x;
          bounds.y = pt.y;

         
          if (bounds.contains(ptMouse)) {
            skinObject.switchSuffix(sSuffix, 2, false, false);
            skinObject = skinObject.getParent();
          } else {
            break;
          }
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.