Package org.eclipse.swt.graphics

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


    transform.translate((int) movClubX, (int) movClubY);
    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();
View Full Code Here


    // 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

    transform.dispose();
    gc.drawImage(ace_club, 0, 0);

    // ace of diamonds
    transform = new Transform(device);
    transform.translate((int) movDiamondX, (int) movDiamondY);
    transform.scale(scaleWidth, scaleWidth);
    gc.setTransform(transform);
    transform.dispose();
    gc.drawImage(ace_diamond, 0, 0);
View Full Code Here

    transform.dispose();
    gc.drawImage(ace_diamond, 0, 0);

    // ace of hearts
    transform = new Transform(device);
    transform.translate(movHeart, height / 2);
    transform.scale(heartScale, 0.5f * scale);
    gc.setTransform(transform);
    transform.dispose();
    gc.drawImage(ace_hearts, 0, 0);

View Full Code Here

    transform.dispose();
    gc.drawImage(ace_hearts, 0, 0);

    // ace of spades
    transform = new Transform(device);
    transform.translate(movSpade, movSpade);
    transform.scale(0.5f * scale, spadeScale);
    gc.setTransform(transform);
    transform.dispose();
    gc.drawImage(ace_spade, 0, 0);
  }
View Full Code Here

    // ----- cubic curve -----
    cubXPos = width / 5;
    cubYPos = height / 3;

    transform = new Transform(device);
    transform.translate(cubXPos, cubYPos);
    gc.setTransform(transform);
    transform.dispose();

    gc.setForeground(device.getSystemColor(SWT.COLOR_RED));
    gc.drawString(GraphicsExample.getResourceString("Cubic"), 25, -70, true);
View Full Code Here

    // ----- quadratic curve -----
    quadXPos = width / 5;
    quadYPos = 2 * height / 3;

    transform = new Transform(device);
    transform.translate(quadXPos, quadYPos);
    gc.setTransform(transform);
    transform.dispose();

    gc.setForeground(device.getSystemColor(SWT.COLOR_GREEN));
    gc.drawString(GraphicsExample.getResourceString("Quadratic"), 0, -50, true);
View Full Code Here

    String text = GraphicsExample.getResourceString("OriginalImg"); //$NON-NLS-1$
    Point size = gc.stringExtent(text);
    gc.drawString(text, (width - size.x) / 2, 25 + bounds.height, true);

    Transform transform = new Transform(device);
    transform.translate((width - (bounds.width * scaleX + 10) * 4) / 2, 25 + bounds.height + size.y
        + (height - (25 + bounds.height + size.y + bounds.height * scaleY)) / 2);
    transform.scale(scaleX, scaleY);

    // --- draw strings ---
    float[] point = new float[2];
View Full Code Here

    final Rectangle rect = image.getBounds();
    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);
View Full Code Here

    }

    for (int j = 0; j < bc.length; j++)
      for (int i = 0; i < bc[j].prevx.size(); i++) {
        Transform transform = new Transform(device);
        transform.translate(((Float) bc[j].prevx.get(bc[j].prevx.size() - (i + 1))).floatValue(),
            ((Float) bc[j].prevy.get(bc[j].prevy.size() - (i + 1))).floatValue());
        gc.setTransform(transform);
        transform.dispose();

        Path path = new Path(device);
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.