Package net.mindengine.galen.page

Examples of net.mindengine.galen.page.Rect


        options.setSampleFilters(spec.getSampleFilters());
        options.setMapFilters(spec.getMapFilters());
        options.setTolerance(tolerance);


        Rect elementArea = pageElement.getArea();

        ImageCheck minCheck = new ImageCheck(spec.getImagePaths().get(0), elementArea.getHeight() * elementArea.getWidth() * 2, null, null);

        Iterator<String> it = spec.getImagePaths().iterator();

        if (!it.hasNext()) {
            throw new ValidationErrorException("There are now images defined to compare with")
View Full Code Here


        SpecImage spec = (SpecImage)readSpec("image: file imgs/image.png, error 112 px, area 10 10 100 20");
        assertThat(spec.getImagePaths(), contains("./imgs/image.png"));
        assertThat(spec.getMaxPercentage(), is(nullValue()));
        assertThat(spec.getMaxPixels(), is(112));
        assertThat(spec.getTolerance(), is(25));
        assertThat(spec.getSelectedArea(), is(new Rect(10,10,100,20)));
    }
View Full Code Here

                throw new RuntimeException(String.format("The cropped area is less than a half of element area (Element {x: %d, y: %d, w: %d, h: %d}, Screenshot {w: %d, h: %d})",
                        elementArea.getLeft(), elementArea.getTop(), newWidth, newHeight,
                        width, height));
            }

            return new Rect(elementArea.getLeft(), elementArea.getTop(), newWidth, newHeight);
        }
        return elementArea;
    }
View Full Code Here

    }
    public int top() {
        return pageElement.getArea().getTop();
    }
    public int right() {
        Rect area = pageElement.getArea();
        return area.getLeft() + area.getWidth();
    }
View Full Code Here

    public int right() {
        Rect area = pageElement.getArea();
        return area.getLeft() + area.getWidth();
    }
    public int bottom() {
        Rect area = pageElement.getArea();
        return area.getTop() + area.getHeight();
    }
View Full Code Here

        checkAvailability(mainObject, objectName);
       
        PageElement secondObject = pageValidation.findPageElement(spec.getObject());
        checkAvailability(secondObject, spec.getObject());
       
        Rect mainArea = mainObject.getArea();
        Rect secondArea = secondObject.getArea();
       
        int offsetLeft = mainArea.getLeft() - secondArea.getLeft();
        int offsetRight = secondArea.getLeft() + secondArea.getWidth() - mainArea.getLeft() - mainArea.getWidth();
       
        int offsetTop = mainArea.getTop() - secondArea.getTop();
        int offsetBottom = secondArea.getTop() + secondArea.getHeight() - mainArea.getTop() - mainArea.getHeight();
       
       
        try {
            if (spec.getLocation() == SpecCentered.Location.INSIDE) {
                checkCentered(offsetLeft, offsetRight, offsetTop, offsetBottom, objectName, spec, "inside");
View Full Code Here

                    "Math.max(" +
                    "document.body.scrollHeight, document.documentElement.scrollHeight," +
                    "document.body.offsetHeight, document.documentElement.offsetHeight," +
                    "document.body.clientHeight, document.documentElement.clientHeight)];"
                );
        return new Rect(0, 0, size.get(0).intValue(), size.get(1).intValue());
    }
View Full Code Here

                    "|| document.body.clientWidth," +
                    "window.innerHeight" +
                    "|| document.documentElement.clientHeight" +
                    "|| document.body.clientHeight];"
                );
        return new Rect(0, 0, size.get(0).intValue(), size.get(1).intValue());
    }
View Full Code Here

    @Override
    public Rect getArea() {
        if (cachedArea == null) {  
            Point location = getWebElement().getLocation();
            Dimension size = getWebElement().getSize();
            cachedArea = new Rect(location.getX(), location.getY(), size.getWidth(), size.getHeight());
           
            if (getLocator() != null && getLocator().getCorrections() != null) {
                cachedArea = correctedRect(cachedArea, getLocator().getCorrections());
            }
        }
View Full Code Here

        }
        return cachedArea;
    }

    private Rect correctedRect(Rect rect, CorrectionsRect corrections) {
        return new Rect(corrections.getLeft().correct(rect.getLeft()),
                corrections.getTop().correct(rect.getTop()),
                corrections.getWidth().correct(rect.getWidth()),
                corrections.getHeight().correct(rect.getHeight()));
    }
View Full Code Here

TOP

Related Classes of net.mindengine.galen.page.Rect

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.