Package org.eclipse.swt.graphics

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


                                                    lineContentWidth);
                            int yOffset = -contentHeight - rectangle.y
                                    - rectangle.x + lineAdjustment
                                    - horizontalPadding + spacing;

                            transform.translate(xOffset, yOffset);
                        }

                        gc.setTransform(transform);

                        gc.drawText(line, rectangle.x, rectangle.y,
View Full Code Here


    gc.setLineWidth(2);

    // ----- cube -----

    Transform transform = new Transform(device);
    transform.translate(width / 4 - size, height / 4 + -upDownValue);
    gc.setTransform(transform);

    gc.setLineStyle(SWT.LINE_DOT);

    // fill in left face
View Full Code Here

    transform.dispose();

    // ----- pyramid -----

    transform = new Transform(device);
    transform.translate(width / 2 + size / 2, height / 4 + size + upDownValue);
    gc.setTransform(transform);

    // fill back of pyramid
    gc.fillPolygon(new int[] { size / 3, -size / 2, 6 * size / 10, -5 * size / 4, 4 * size / 3, -size / 2 });

View Full Code Here

    transform.dispose();

    // ----- rectangular prism -----

    transform = new Transform(device);
    transform.translate(width / 2 + upDownValue, height / 2 + size);
    gc.setTransform(transform);

    // fill bottom
    gc.setBackground(device.getSystemColor(SWT.COLOR_BLUE));
    gc.fillPolygon(new int[] { 0, size, size / 3, size / 2, 7 * size / 3, size / 2, 2 * size, size });
View Full Code Here

    transform.dispose();

    // ----- triangular shape -----
    transform = new Transform(device);
    transform.translate(width / 4 - size - upDownValue, height / 2 + size + upDownValue);
    gc.setTransform(transform);

    // fill back of shape (top left)
    gc.setBackground(device.getSystemColor(SWT.COLOR_YELLOW));
    gc.fillPolygon(new int[] { 0, 0, size / 2, -size, size / 2, -size / 3 });
View Full Code Here

    // ----- letter s -----
    sXPos = 4 * width / 16;
    sYPos = (height - 150) / 2;

    transform = new Transform(device);
    transform.translate(sXPos, sYPos);
    gc.setTransform(transform);
    transform.dispose();

    gc.setForeground(device.getSystemColor(SWT.COLOR_DARK_BLUE));
    gc.drawString(GraphicsExample.getResourceString("Cubic"), 0, 175, true);
View Full Code Here

    // ----- letter w -----
    wXPos = 6 * width / 16;
    wYPos = (height - 150) / 2;

    transform = new Transform(device);
    transform.translate(wXPos, wYPos);
    gc.setTransform(transform);
    transform.dispose();

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

    Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "houses.png");
    Rectangle bounds = image.getBounds();

    // top
    Transform transform = new Transform(device);
    transform.translate((width - bounds.width) / 2, (height - bounds.height) / 2);
    transform.scale(1, -1);
    gc.setTransform(transform);

    // draw the original image
    gc.drawImage(image, 0, 0);
View Full Code Here

    transform.dispose();

    // bottom
    transform = new Transform(device);
    transform.translate((width - bounds.width) / 2, 2 * bounds.height + (height - bounds.height) / 2);
    transform.scale(1, -1);
    gc.setTransform(transform);

    // draw the original image
    gc.drawImage(image, 0, 0);
View Full Code Here

    transform.dispose();

    // left
    transform = new Transform(device);
    transform.translate((width - bounds.width) / 2, (height - bounds.height) / 2);
    transform.scale(-1, 1);
    gc.setTransform(transform);

    // draw the original image
    gc.drawImage(image, 0, 0);
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.