Package org.eclipse.swt.graphics

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


                .getDoubleY()
                - ((double) bounds.height / 2));

            tr.translate((int) ((double) bounds.width / 2 + x),
                (int) ((double) bounds.height / 2 + y));
            tr.rotate(heading);
            tr.translate((int) (-((double) bounds.width / 2 + x)),
                (int) (-((double) bounds.height / 2 + y)));
            gc.setTransform(tr);
            gc.drawImage(robot.getImage(), x, y);
View Full Code Here


        result = result - 360;
      drawCarRotation = result;
    } else {
      drawCarRotation = carRotation;
    }
    transform.rotate((float) drawCarRotation);
    transform.translate(-(carPosition.x), -(carPosition.y));
    gc.setTransform(transform);
    /*
     * Now the graphics has been set up appropriately; draw the car in position
     */
 
View Full Code Here

        tmpGc.drawText(text, 0, 0);

        // set transform to rotate
        Transform transform = new Transform(gc.getDevice());
        transform.translate(x, y);
        transform.rotate(360 - angle);
        gc.setTransform(transform);

        // draw the image on the rotated graphics context
        gc.drawImage(image, 0, 0);
View Full Code Here

            tmpGc.drawText(text, 0, 0);

            // set transform to rotate
            Transform transform = new Transform(gc.getDevice());
            transform.translate(0, textWidth);
            transform.rotate(270);
            gc.setTransform(transform);

            // draw the image on the rotated graphics context
            int y = (int) (height / 2d - textWidth / 2d);
            if (y < 0) {
View Full Code Here

     * @param theta  the angle of rotation.
     */
    public void rotate(double theta) {
        Transform swtTransform = new Transform(this.gc.getDevice());
        this.gc.getTransform(swtTransform);
        swtTransform.rotate((float) (theta * 180 / Math.PI));
        this.gc.setTransform(swtTransform);
        swtTransform.dispose();
    }

    /**
 
View Full Code Here

                    int contentWidth = Math.min(getLengthFromCache(gc, text),
                            rectangle.height);

                    Transform transform = new Transform(gc.getDevice());
                    if (!isRotateClockwise()) {
                        transform.rotate(-90f);

                        int xOffset = -rectangle.x
                                + (-contentWidth - rectangle.y)
                                - CellStyleUtil.getVerticalAlignmentPadding(
                                        cellStyle, rectangle, contentWidth);
View Full Code Here

                                        cellStyle, rectangle, contentHeight)
                                + spacing;

                        transform.translate(xOffset, yOffset);
                    } else {
                        transform.rotate(90f);

                        int horizontalPadding = CellStyleUtil
                                .getHorizontalAlignmentPadding(cellStyle,
                                        rectangle, contentHeight);
                        if (horizontalPadding != 0) {
View Full Code Here

                                getLengthFromCache(gc, line), rectangle.height);

                        Transform transform = new Transform(gc.getDevice());

                        if (!isRotateClockwise()) {
                            transform.rotate(-90f);

                            int xOffset = -rectangle.x
                                    + (-lineContentWidth - rectangle.y)
                                    - CellStyleUtil
                                            .getVerticalAlignmentPadding(
View Full Code Here

                                                    cellStyle, rectangle,
                                                    contentHeight) + spacing;

                            transform.translate(xOffset, yOffset);
                        } else {
                            transform.rotate(90f);

                            int horizontalPadding = CellStyleUtil
                                    .getHorizontalAlignmentPadding(cellStyle,
                                            rectangle, contentHeight);
                            if (horizontalPadding != 0) {
View Full Code Here

    transform.scale(scaleSpinnerX.getSelection() / 100f, scaleSpinnerY.getSelection() / 100f);

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

    if (invertButton.getSelection())
      transform.invert();
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.