Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Transform.rotate()


    gc.setAlpha(alphaSpinner.getSelection());

    // rotate on center
    Transform transform = new Transform(device);
    transform.translate(width / 2, height / 2);
    transform.rotate(-angle);
    transform.translate(-width / 2, -height / 2);
    gc.setTransform(transform);
    transform.dispose();

    // choose the smallest between height and width
View Full Code Here


    Transform transform;
    int n = petalSpinner.getSelection();
    for (int i = 0; i < n; i++) {
      transform = new Transform(device);
      transform.translate(width / 2, height / 2);
      transform.rotate(-(angle + 360 / n * i));
      gc.setTransform(transform);
      gc.drawArc(0, 0, width / 3, height / 6, 0, 180);
      transform.dispose();
    }

View Full Code Here

      gc.drawString(new Integer(nextNumber).toString(), (width - textWidth) / 2, (height - textHeight) / 2, true);

      // draw the rotating arm
      Transform transform = new Transform(device);
      transform.translate(width / 2, height / 2);
      transform.rotate(angle);
      gc.setTransform(transform);
      gc.setForeground(device.getSystemColor(SWT.COLOR_RED));
      gc.drawLine(0, 0, diameter / 2, 0);
      transform.dispose();
View Full Code Here

    transform.scale(scaleWidth, scaleWidth);

    // rotate on center of image
    Rectangle rect = ace_club.getBounds();
    transform.translate(rect.width / 2, rect.height / 2);
    transform.rotate(rotationAngle);
    transform.translate(-rect.width / 2, -rect.height / 2);

    gc.setTransform(transform);
    transform.dispose();
    gc.drawImage(ace_club, 0, 0);
View Full Code Here

    shell.addListener(SWT.Paint, new Listener() {
      public void handleEvent(Event event) {
        GC gc = event.gc;
        Transform tr = new Transform(display);
        tr.translate(rect.width / 4, rect.height / 2);
        tr.rotate(-30);
        if (image != null)
          gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, rect.width, rect.height);
        gc.setAlpha(100);
        gc.setTransform(tr);
        Path path = new Path(display);
View Full Code Here

    transform = new Transform(device);
    transform.translate(width - diagTranslateX1, height / 2 - diagTranslateY1);

    // rotate on center of rectangle
    transform.translate(rect.width / 2, rect.height / 2);
    transform.rotate(45);
    transform.translate(-rect.width / 2, -rect.height / 2);
    gc.setTransform(transform);
    transform.dispose();

    path = new Path(device);
View Full Code Here

    transform = new Transform(device);
    transform.translate(width - diagTranslateX2, height / 2 - diagTranslateY2);

    // rotate on center of rectangle
    transform.translate(rect.width / 2, rect.height / 2);
    transform.rotate(-45);
    transform.translate(-rect.width / 2, -rect.height / 2);
    gc.setTransform(transform);
    transform.dispose();

    path = new Path(device);
View Full Code Here

      @Override
      public void handleEvent(Event event) {
        GC gc = event.gc;
        Transform tr = new Transform(display);
        tr.translate(50, 120);
        tr.rotate(-30);
        gc.drawImage(image, 0, 0, rect.width, rect.height, 0, 0, rect.width / 2, rect.height / 2);
        gc.setAlpha(100);
        gc.setTransform(tr);
        Path path = new Path(display);
        path.addString("SWT", 0, 0, font);
View Full Code Here

            gc.getTransform(oldTransform);

            final Transform transform = new Transform(gc.getDevice());
            transform.translate(offsetX + image.getBounds().width / 2, offsetY
                + image.getBounds().height / 2);
            transform.rotate(rotation);
            transform.translate(-(offsetX + image.getBounds().width / 2),
                -(offsetY + image.getBounds().height / 2));
            gc.setTransform(transform);
            gc.drawImage(image, offsetX, offsetY);
            gc.setTransform(oldTransform);
View Full Code Here

            {
                final Transform transform = new Transform(event.display);
                try
                {
                    transform.translate(r.x, r.y);
                    transform.rotate(-90);
                    event.gc.setTransform(transform);
                    event.gc.drawString(label, -labelExtend.x - 2, 2, true);
                    event.gc.drawString(info, -infoExtend.x - 2, 2 + labelExtend.y, true);
                }
                finally
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.