Package javafx.geometry

Examples of javafx.geometry.Bounds


        Bounds bounds = bounds(x, y, width, height);
        return withOffset(bounds, insets);
    }

    public Bounds boundsWithInsets(double x, double y, double width, double height, Insets insets) {
        Bounds bounds = bounds(x, y, width, height);
        return withInsets(bounds, insets);
    }
View Full Code Here


        return isNodeWithinSceneBounds(node);
    }

    private boolean isNodeWithinSceneBounds(Node node) {
        Scene scene = node.getScene();
        Bounds nodeBounds = node.localToScene(node.getBoundsInLocal());
        return nodeBounds.intersects(0, 0, scene.getWidth(), scene.getHeight());
    }
View Full Code Here

    // METHODS.
    //---------------------------------------------------------------------------------------------

    @Override
    public Point2D query() {
        Bounds bounds = fetchCallableBounds();
        PointQuery boundsQuery = new BoundsPointQuery(bounds)
            .atPosition(getPosition())
            .atOffset(getOffset());
        return boundsQuery.query();
    }
View Full Code Here

        );
    }

    @Override
    public Bounds boundsInWindowFor(Bounds boundsInScene, Scene scene) {
        Bounds visibleBoundsInScene = limitToVisibleBounds(boundsInScene, scene);
        Bounds windowBounds = boundsInWindowFor(scene);
        return translateBounds(visibleBoundsInScene,
            windowBounds.getMinX(), windowBounds.getMinY());
    }
View Full Code Here

            windowBounds.getMinX(), windowBounds.getMinY());
    }

    @Override
    public Bounds boundsOnScreenFor(Node node) {
        Bounds sceneBounds = boundsInSceneFor(node);
        return boundsOnScreenFor(sceneBounds, node.getScene());
    }
View Full Code Here

        return boundsOnScreenFor(sceneBounds, node.getScene());
    }

    @Override
    public Bounds boundsOnScreenFor(Scene scene) {
        Bounds windowBounds = boundsInWindowFor(scene);
        Window window = scene.getWindow();
        return translateBounds(windowBounds, window.getX(), window.getY());
    }
View Full Code Here

        );
    }

    @Override
    public Bounds boundsOnScreenFor(Bounds boundsInScene, Scene scene) {
        Bounds windowBounds = boundsInWindowFor(boundsInScene, scene);
        Window window = scene.getWindow();
        return translateBounds(windowBounds, window.getX(), window.getY());
    }
View Full Code Here

    //---------------------------------------------------------------------------------------------
    // PRIVATE METHODS.
    //---------------------------------------------------------------------------------------------

    private Bounds limitToVisibleBounds(Bounds boundsInScene, Scene scene) {
        Bounds sceneBounds = makeSceneBounds(scene);
        Bounds visibleBounds = intersectBounds(boundsInScene, sceneBounds);
        if (!areBoundsVisible(visibleBounds)) {
            throw new BoundsLocatorException("Bounds are not visible in Scene.");
        }
        return visibleBounds;
    }
View Full Code Here

        return new BoundsPointQuery(bounds);
    }

    @Override
    public PointQuery pointFor(Point2D point) {
        Bounds bounds = new BoundingBox(point.getX(), point.getY(), 0, 0);
        return new BoundsPointQuery(bounds);
    }
View Full Code Here

    // METHODS.
    //---------------------------------------------------------------------------------------------

    @Override
    public Bounds boundsInSceneFor(Node node) {
        Bounds sceneBounds = node.localToScene(node.getBoundsInLocal());
        return limitToVisibleBounds(sceneBounds, node.getScene());
    }
View Full Code Here

TOP

Related Classes of javafx.geometry.Bounds

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.