Package org.eclipse.swt.graphics

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


        gc.drawRectangle(0,0,photoCanvas.getBounds().width-1,photoCanvas.getBounds().height-1);
        photoCanvas.addListener(SWT.Paint, new Listener(){
            public void handleEvent(Event arg0) {
                GC gc = new GC(photoCanvas);
                gc.drawImage(image,0,0,image.getBounds().width,image.getBounds().height,0,0,362,198);
                gc.drawRectangle(0,0,photoCanvas.getBounds().width-1,photoCanvas.getBounds().height-1);     
                gc.dispose();
            }
        });
        gc.dispose();
    }
View Full Code Here


    private void drawPhoto(Image imageToLoad) {
      final Image image = new Image(parent.getDisplay(), imageToLoad.getImageData());
        GC gc = new GC(photoCanvas);
        gc.drawImage(image,0,0,image.getBounds().width,image.getBounds().height, 0, 0, width, height);
        gc.drawRectangle(0,0,photoCanvas.getBounds().width-1,photoCanvas.getBounds().height-1);
        photoCanvas.addListener(SWT.Paint, new Listener(){
            public void handleEvent(Event arg0) {
                GC gc = new GC(photoCanvas);
                gc.drawImage(image,0,0,image.getBounds().width,image.getBounds().height,0,0,width,height);
                gc.drawRectangle(0,0,photoCanvas.getBounds().width-1,photoCanvas.getBounds().height-1);     
View Full Code Here

        gc.drawRectangle(0,0,photoCanvas.getBounds().width-1,photoCanvas.getBounds().height-1);
        photoCanvas.addListener(SWT.Paint, new Listener(){
            public void handleEvent(Event arg0) {
                GC gc = new GC(photoCanvas);
                gc.drawImage(image,0,0,image.getBounds().width,image.getBounds().height,0,0,width,height);
                gc.drawRectangle(0,0,photoCanvas.getBounds().width-1,photoCanvas.getBounds().height-1);     
                gc.dispose();
            }
        });
        gc.dispose();
    }
View Full Code Here

                    GC gc = new GC(image);
                    gc.setBackground(tree.getViewer().getControl()
                            .getBackground());
                    gc.setForeground(tree.getViewer().getControl()
                            .getBackground());
                    gc.drawRectangle(0, 0, imageSize - 1, imageSize - 1);

                    gc.setForeground(tree.getViewer().getControl()
                            .getForeground());
                    gc.setBackground(c);
View Full Code Here

                    gc.setForeground(tree.getViewer().getControl()
                            .getForeground());
                    gc.setBackground(c);

                    int offset = (imageSize - usableImageSize) / 2;
                    gc.drawRectangle(offset, offset, usableImageSize - offset,
                            usableImageSize - offset);
                    gc.fillRectangle(offset + 1, offset + 1, usableImageSize
                            - offset - 1, usableImageSize - offset - 1);
                    gc.dispose();
View Full Code Here

        gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
       
        for (Button button : buttons) {
          Rectangle bounds = button.getBounds();
          gc.fillRectangle(bounds);
          gc.drawRectangle(bounds.x, bounds.y, bounds.width - 1, bounds.height - 1);
        }
       
        gc.setForeground(foreground);
        gc.setBackground(background);
      }
View Full Code Here

        gc.drawString("Feel free to change the destination at any time.", 5, 35);

        gc.setBackground(f_ball.getRecColor());
        gc.setForeground(e.widget.getDisplay().getSystemColor(SWT.COLOR_BLACK));
        gc.fillRectangle(f_ball.getRect());
        gc.drawRectangle(f_ball.getRect());
        gc.drawImage(f_ball.image, f_ball.location.x, f_ball.location.y);
      }
    });
    addMouseListener(new MouseAdapter() {
View Full Code Here

      if (!inactiveBorder
          && (control instanceof Text || control instanceof CCombo || textBorder)) {
        Rectangle b = control.getBounds();
        GC gc = paintEvent.gc;
        gc.setForeground(control.getBackground());
        gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1,
            b.height + 1);
        // gc.setForeground(getBorderStyle() == SWT.BORDER ? colors
        // .getBorderColor() : colors.getForeground());
        gc.setForeground(NOAUIPlugin.getFormToolkit().getColors().getBorderColor());
        if (control instanceof CCombo)
View Full Code Here

            b.height + 1);
        // gc.setForeground(getBorderStyle() == SWT.BORDER ? colors
        // .getBorderColor() : colors.getForeground());
        gc.setForeground(NOAUIPlugin.getFormToolkit().getColors().getBorderColor());
        if (control instanceof CCombo)
          gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1,
              b.height + 1);
        else
          gc.drawRectangle(b.x - 1, b.y - 2, b.width + 1,
              b.height + 3);
      }
View Full Code Here

        gc.setForeground(NOAUIPlugin.getFormToolkit().getColors().getBorderColor());
        if (control instanceof CCombo)
          gc.drawRectangle(b.x - 1, b.y - 1, b.width + 1,
              b.height + 1);
        else
          gc.drawRectangle(b.x - 1, b.y - 2, b.width + 1,
              b.height + 3);
      }
      else if (inactiveBorder || control instanceof Table
          || control instanceof Tree || control instanceof TableTree) {
        Rectangle b = control.getBounds();
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.