Package javafx.geometry

Examples of javafx.geometry.Point2D


    private void addBlurLayer() {
        setVisible(false);
        getChildren().removeAll(blurView, colorGlass);

        SnapshotParameters parameters = new SnapshotParameters();
        Point2D startPointInScene = localToScene(0, 0);
        Rectangle2D toPaint = new Rectangle2D(startPointInScene.getX(), startPointInScene.getY(), getLayoutBounds().getWidth(), getLayoutBounds().getHeight());
        parameters.setViewport(toPaint);
        WritableImage image = new WritableImage((int) toPaint.getWidth(), (int) toPaint.getHeight());
        image = getScene().getRoot().snapshot(parameters, image);
        blurView.setImage(image);
        getChildren().addAll(blurView, colorGlass);
View Full Code Here


    //---------------------------------------------------------------------------------------------

    @Test
    public void atPosition_double_double_case_1() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atPosition(0.0, 0.0).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100, 200)));
    }
View Full Code Here

    }

    @Test
    public void atPosition_double_double_case_2() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atPosition(1.0, 1.0).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100 + 300, 200 + 400)));
    }
View Full Code Here

    }

    @Test
    public void atPosition_double_double_case_3() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atPosition(0.5, 0.5).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100 + 150, 200 + 200)));
    }
View Full Code Here

    }

    @Test
    public void atPosition_Pos_case_1() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atPosition(Pos.TOP_LEFT).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100, 200)));
    }
View Full Code Here

    }

    @Test
    public void atPosition_Pos_case_2() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atPosition(Pos.BOTTOM_RIGHT).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100 + 300, 200 + 400)));
    }
View Full Code Here

    }

    @Test
    public void atPosition_Pos_case_3() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atPosition(Pos.CENTER).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100 + 150, 200 + 200)));
    }
View Full Code Here

    }

    @Test
    public void atOffset_double_double_case_1() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atOffset(0, 0).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100, 200)));
    }
View Full Code Here

    }

    @Test
    public void atOffset_double_double_case_2() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atOffset(300, 400).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100 + 300, 200 + 400)));
    }
View Full Code Here

    }

    @Test
    public void atOffset_double_double_case_3() {
        // when:
        Point2D point = new BoundsPointQuery(bounds).atOffset(150, 200).query();

        // then:
        assertThat(point, Matchers.equalTo(new Point2D(100 + 150, 200 + 200)));
    }
View Full Code Here

TOP

Related Classes of javafx.geometry.Point2D

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.