Package org.jemmy

Examples of org.jemmy.Dimension


     * @param size
     * @param direction
     */
    public void resize(Dimension size, Direction direction) {
        Point start = null, target = null;
        Dimension sizeDiff = new Dimension(size.width - control.getScreenBounds().width, size.height - control.getScreenBounds().height);
        switch(direction) {
            case NORTHWEST:
                start = new Point(offset, offset);
                target = new Point(start.x - sizeDiff.width, start.y - sizeDiff.height);
                break;
View Full Code Here


     * @param image1
     * @param image2
     * @return
     */
    public boolean compare(Raster image1, Raster image2) {
        Dimension size = PixelImageComparator.computeDiffSize(image1, image2);
        if(size == null) {
            return false;
        }
        int totalPixels = size.width * size.height;
        int offPixels = 0;
View Full Code Here

     * @param image1
     * @param image2
     * @return
     */
    public boolean compare(Raster image1, Raster image2) {
        Dimension size = PixelImageComparator.computeDiffSize(image1, image2);
        if (size == null) {
            return false;
        }
        int totalPixels = size.width * size.height;
        double distance = 0;
View Full Code Here

     * @param image1
     * @param image2
     * @return
     */
    public WriteableRaster computeDifference(Raster image1, Raster image2) {
        Dimension size = computeDiffSize(image1, image2);
        if (size == null) {
            size = new Dimension(Math.max(image1.getSize().width, image2.getSize().width),
                    Math.max(image1.getSize().height, image2.getSize().height));
        }
        WriteableRaster res = createDiffRaster(image1, image2);
        double[] colors1 = new double[image1.getSupported().length];
        double[] colors2 = new double[image2.getSupported().length];
View Full Code Here

     */
    public Image compare(Image image1, Image image2) {
        if(image1 == null || image2 == null) {
            return (image1 == null) ? image2 : image1;
        }
        Dimension size;
        switch (mode) {
            case LEFT:
                size = getSize(image1);
                break;
            case RIGTH:
                size = getSize(image2);
                break;
            case MAX:
                Dimension size1 = getSize(image1);
                Dimension size2 = getSize(image2);
                size = new Dimension(Math.max(size1.width, size2.width),
                        Math.max(size1.height, size2.height));
                break;
            default:
                throw new IllegalStateException("mode is not recognized");
        }
View Full Code Here

     * @param image1
     * @param image2
     * @return
     */
    public boolean compare(Raster image1, Raster image2) {
        Dimension size = PixelImageComparator.computeDiffSize(image1, image2);
        if (size == null) {
            return false;
        }
        double[] colors1 = new double[image1.getSupported().length];
        double[] colors2 = new double[image2.getSupported().length];
View Full Code Here

     *
     * @param d
     * @return org.jemmy.Dimension
     */
    public static Dimension convert(java.awt.Dimension d) {
        return new Dimension(d.width, d.height);
    }
View Full Code Here

        this.propDistThreshold = propDistThreshold;
    }

    @Override
    public Image resize(Image image, Dimension size) {
        Dimension isize = getSize(image);
        double scalex = (double) size.width / isize.width;
        double scaley = (double) size.height / isize.height;
        switch (resizeMode) {
            case NO_RESIZE:
                return image;
View Full Code Here

    }

    @Override
    public Dimension getSize(Image image) {
        BufferedImage bi = ((AWTImage)image).getTheImage();
        return new Dimension(bi.getWidth(), bi.getHeight());
    }
View Full Code Here

            throw new JemmyException("Unable to save image", ex, fileName);
        }
    }

    public Dimension getSize() {
        return new Dimension(image.getWidth(), image.getHeight());
    }
View Full Code Here

TOP

Related Classes of org.jemmy.Dimension

Copyright © 2018 www.massapicom. 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.