Package org.eclipse.swt.graphics

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


    gc.setTransform(transform);
    /*
     * Now the graphics has been set up appropriately; draw the car in position
     */
    gc.drawImage(car, carPosition.x - carWHalf, carPosition.y - carHHalf);
    transform.dispose();
  }

  public void setCarPosition(Point newPosition) {
    carPosition.x = newPosition.x;
    carPosition.y = newPosition.y;
View Full Code Here


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

        // dispose resources
        tmpGc.dispose();
        transform.dispose();
        image.dispose();
        gc.setTransform(null);
    }

    /**
 
View Full Code Here

            }
            gc.drawImage(image, -y, 0);

            // dispose resources
            tmpGc.dispose();
            transform.dispose();
            image.dispose();
        }
    }
}
View Full Code Here

     */
    public AffineTransform getTransform() {
        Transform swtTransform = new Transform(this.gc.getDevice());
        this.gc.getTransform(swtTransform);
        AffineTransform awtTransform = toAwtTransform(swtTransform);
        swtTransform.dispose();
        return awtTransform;
    }

    /**
     * Sets the current transform.
View Full Code Here

    public void transform(AffineTransform t) {
        Transform swtTransform = new Transform(this.gc.getDevice());
        this.gc.getTransform(swtTransform);
        swtTransform.multiply(getSwtTransformFromPool(t));
        this.gc.setTransform(swtTransform);
        swtTransform.dispose();
    }

    /**
     * Applies a translation.
     *
 
View Full Code Here

    public void translate(int x, int y) {
        Transform swtTransform = new Transform(this.gc.getDevice());
        this.gc.getTransform(swtTransform);
        swtTransform.translate(x, y);
        this.gc.setTransform(swtTransform);
        swtTransform.dispose();
    }

    /**
     * Applies a translation.
     *
 
View Full Code Here

    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();
    }

    /**
     * Not implemented - see {@link Graphics2D#rotate(double, double, double)}.
     *
 
View Full Code Here

    public void scale(double scaleX, double scaleY) {
        Transform swtTransform = new Transform(this.gc.getDevice());
        this.gc.getTransform(swtTransform);
        swtTransform.scale((float) scaleX, (float) scaleY);
        this.gc.setTransform(swtTransform);
        swtTransform.dispose();
    }

    /**
     * Applies a shear transform.
     *
 
View Full Code Here

                            printLayer(gc, printBounds);

                            printFooter(gc, currentPage, printBounds);

                            printer.endPage();
                            printerTransform.dispose();
                        }
                        currentPage++;
                    }
                }
View Full Code Here

    // fill right side of cube
    gc.setBackground(device.getSystemColor(SWT.COLOR_GRAY));
    gc.fillPolygon(new int[] { size, 0, 4 * size / 3, -size / 2, 4 * size / 3, size / 2, size, size });

    transform.dispose();

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

    transform = new Transform(device);
    transform.translate(width / 2 + size / 2, height / 4 + size + upDownValue);
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.