Package org.eclipse.swt.graphics

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


    GC gcImage = new GC(image);
    gcImage.setForeground(Colors.blue);
    int angle = (percent * 360) / 100;
    gcImage.setBackground(Colors.blues[Colors.BLUES_MIDDARK]);
    gcImage.fillArc(0,0,width,height,90-angle,angle);
    gcImage.drawOval(0 , 0 , width-1, height-1);
    gcImage.dispose();
    return image;
  }
 
  public static void drawPie(GC gc,int x, int y,int width,int height,int percent) {
View Full Code Here


    // Geschlecht zeichnen.
    if (sex.equals(Person.MALE)) {
      gc.setBackground(SwtConsts.COLOR_BLUE);
      gc.fillRectangle(0, 0, psize.x, psize.y);
      gc.drawOval(x + 3 * size / 20, y + 9 * size / 20, 9 * size / 20, 9 * size / 20);
      gc.drawLine(x + 10 * size / 20, y + 10 * size / 20, x + 16 * size / 20, y + 1 * size / 20);
      gc.drawLine(x + 16 * size / 20, y + 1 * size / 20, x + 12 * size / 20, y + 3 * size / 20);
      gc.drawLine(x + 16 * size / 20, y + 1 * size / 20, x + 16 * size / 20, y + 6 * size / 20);
      // gc.drawRectangle(x, y, 19 * size / 20, 19 * size / 20);
    }
View Full Code Here

      // gc.drawRectangle(x, y, 19 * size / 20, 19 * size / 20);
    }
    else if (sex.equals(Person.FEMALE)) {
      gc.setBackground(SwtConsts.COLOR_RED);
      gc.fillRectangle(0, 0, psize.x, psize.y);
      gc.drawOval(x + 5 * size / 20, y + 1 * size / 20, 9 * size / 20, 9 * size / 20);
      gc.drawLine(x + 9 * size / 20, y + 10 * size / 20, x + 9 * size / 20, y + 18 * size / 20);
      gc.drawLine(x + 6 * size / 20, y + 14 * size / 20, x + 12 * size / 20, y + 14 * size / 20);
    }
    else if (sex.equals(Person.NO_SEX)) {
      gc.setBackground(SwtConsts.COLOR_DARK_GRAY);
View Full Code Here

      gc.drawLine(x + 6 * size / 20, y + 14 * size / 20, x + 12 * size / 20, y + 14 * size / 20);
    }
    else if (sex.equals(Person.NO_SEX)) {
      gc.setBackground(SwtConsts.COLOR_DARK_GRAY);
      gc.fillRectangle(0, 0, psize.x, psize.y);
      gc.drawOval(x + 5 * size / 20, y + 5 * size / 20, 9 * size / 20, 9 * size / 20);
    }
    else if (sex.equals(Person.BOTH)) {
      gc.setBackground(SwtConsts.COLOR_MAGENTA);
      gc.fillRectangle(0, 0, psize.x, psize.y);
      gc.drawOval(x + 5 * size / 20, y + 6 * size / 20, 7 * size / 20, 7 * size / 20);
View Full Code Here

      gc.drawOval(x + 5 * size / 20, y + 5 * size / 20, 9 * size / 20, 9 * size / 20);
    }
    else if (sex.equals(Person.BOTH)) {
      gc.setBackground(SwtConsts.COLOR_MAGENTA);
      gc.fillRectangle(0, 0, psize.x, psize.y);
      gc.drawOval(x + 5 * size / 20, y + 6 * size / 20, 7 * size / 20, 7 * size / 20);
      gc.drawLine(x + 11 * size / 20, y + 7 * size / 20, x + 15 * size / 20, y + 1 * size / 20); // M
      gc.drawLine(x + 15 * size / 20, y + 1 * size / 20, x + 11 * size / 20, y + 2 * size / 20);
      gc.drawLine(x + 15 * size / 20, y + 1 * size / 20, x + 15 * size / 20, y + 5 * size / 20);
      gc.drawLine(x + 8 * size / 20, y + 13 * size / 20, x + 8 * size / 20, y + 18 * size / 20); // W
      gc.drawLine(x + 6 * size / 20, y + 15 * size / 20, x + 10 * size / 20, y + 15 * size / 20);
View Full Code Here

        gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
        gc.fillOval((int) screenCoords[0] - size / 2, (int) screenCoords[1] - size / 2, size, size);
        gc.fillOval((int) screenCoords[2] - size / 2, (int) screenCoords[3] - size / 2, size, size);
        gc.fillOval((int) screenCoords[4] - size / 2, (int) screenCoords[5] - size / 2, size, size);
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
        gc.drawOval((int) screenCoords[0] - size / 2, (int) screenCoords[1] - size / 2, size, size);
        gc.drawOval((int) screenCoords[2] - size / 2, (int) screenCoords[3] - size / 2, size, size);
        gc.drawOval((int) screenCoords[4] - size / 2, (int) screenCoords[5] - size / 2, size, size);

        gc.setAntialias(SWT.OFF);
        gc.dispose();
View Full Code Here

        gc.fillOval((int) screenCoords[0] - size / 2, (int) screenCoords[1] - size / 2, size, size);
        gc.fillOval((int) screenCoords[2] - size / 2, (int) screenCoords[3] - size / 2, size, size);
        gc.fillOval((int) screenCoords[4] - size / 2, (int) screenCoords[5] - size / 2, size, size);
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
        gc.drawOval((int) screenCoords[0] - size / 2, (int) screenCoords[1] - size / 2, size, size);
        gc.drawOval((int) screenCoords[2] - size / 2, (int) screenCoords[3] - size / 2, size, size);
        gc.drawOval((int) screenCoords[4] - size / 2, (int) screenCoords[5] - size / 2, size, size);

        gc.setAntialias(SWT.OFF);
        gc.dispose();
View Full Code Here

        gc.fillOval((int) screenCoords[2] - size / 2, (int) screenCoords[3] - size / 2, size, size);
        gc.fillOval((int) screenCoords[4] - size / 2, (int) screenCoords[5] - size / 2, size, size);
        gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
        gc.drawOval((int) screenCoords[0] - size / 2, (int) screenCoords[1] - size / 2, size, size);
        gc.drawOval((int) screenCoords[2] - size / 2, (int) screenCoords[3] - size / 2, size, size);
        gc.drawOval((int) screenCoords[4] - size / 2, (int) screenCoords[5] - size / 2, size, size);

        gc.setAntialias(SWT.OFF);
        gc.dispose();

        // overlay the image
View Full Code Here

                startAngle += arcAngle;
            }

            // circle
            gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
            gc.drawOval(centerX - radius, centerY - radius, diameter, diameter);

            // edges
            startAngle = 0;
            for (Slice slice : slices)
            {
View Full Code Here

    display.asyncExec(new Runnable() {
      public void run() {
        GC gc = new GC(canvas);
        setupGC(gc);
        // gc.setForeground(new Color(display,new RGB(128,128,128)));
        gc.drawOval(startX, startY, endX - startX, endY - startY);
        gc.dispose();
      }
    });

  }
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.