Package javafx.geometry

Examples of javafx.geometry.BoundingBox


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

    @Override
    public Bounds boundsInWindowFor(Scene scene) {
        return new BoundingBox(
            scene.getX(), scene.getY(),
            scene.getWidth(), scene.getHeight()
        );
    }
View Full Code Here


        return translateBounds(windowBounds, window.getX(), window.getY());
    }

    @Override
    public Bounds boundsOnScreenFor(Window window) {
        return new BoundingBox(
            window.getX(), window.getY(),
            window.getWidth(), window.getHeight()
        );
    }
View Full Code Here

        }
        return visibleBounds;
    }

    private Bounds makeSceneBounds(Scene scene) {
        return new BoundingBox(0, 0, scene.getWidth(), scene.getHeight());
    }
View Full Code Here

        double minY = Math.max(a.getMinY(), b.getMinY());
        double maxX = Math.min(a.getMaxX(), b.getMaxX());
        double maxY = Math.min(a.getMaxY(), b.getMaxY());
        double width = maxX - minX;
        double height = maxY - minY;
        return new BoundingBox(minX, minY, width, height);
    }
View Full Code Here

    private boolean areBoundsVisible(Bounds bounds) {
        return bounds.getWidth() >= 0 && bounds.getHeight() >= 0; //TODO always true...
    }

    private Bounds translateBounds(Bounds bounds, double x, double y) {
        return new BoundingBox(
            bounds.getMinX() + x, bounds.getMinY() + y,
            bounds.getWidth(), bounds.getHeight()
        );
    }
View Full Code Here

                Window window = node.getControl().getScene().getWindow();
                if (Double.isNaN(window.getX())) { // TODO: temporary stub for RT-12736
                    setResult(true);
                    return;
                }
                Bounds bounds = new BoundingBox(window.getX(), window.getY(), 0, window.getWidth(), window.getHeight(), 0);
                double x = node.getScreenBounds().getX();
                double y = node.getScreenBounds().getY();
                if (p == null) {
                    x+= node.getClickPoint().getX();
                    y+= node.getClickPoint().getY();
                } else {
                    x+= p.getX();
                    y+= p.getY();
                }
                setResult(bounds.contains(x, y));
            }
        }.dispatch(node.getEnvironment());
    }
View Full Code Here

        } else {
            ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
            Screen screen = screensForRectangle.get(0);
            Rectangle2D visualBounds = screen.getVisualBounds();

            savedBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());

            undecorator.setShadow(false);

            stage.setX(visualBounds.getMinX());
            stage.setY(visualBounds.getMinY());
View Full Code Here

        }
    }

    public void saveBounds() {
        Stage stage = undecorator.getStage();
        savedBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
    }
View Full Code Here

        savedBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
    }

    public void saveFullScreenBounds() {
        Stage stage = undecorator.getStage();
        savedFullScreenBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
    }
View Full Code Here

        ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
        Screen screen = screensForRectangle.get(0);
        Rectangle2D visualBounds = screen.getVisualBounds();
        // Dock Left
        if (mouseEvent.getScreenX() == visualBounds.getMinX()) {
            savedBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());

            stage.setX(visualBounds.getMinX());
            stage.setY(visualBounds.getMinY());
            // Respect Stage Max size
            double width = visualBounds.getWidth() / 2;
            if (stage.getMaxWidth() < width) {
                width = stage.getMaxWidth();
            }

            stage.setWidth(width);

            double height = visualBounds.getHeight();
            if (stage.getMaxHeight() < height) {
                height = stage.getMaxHeight();
            }

            stage.setHeight(height);
            undecorator.setShadow(false);
        } // Dock Right (visualBounds = [minX = 1440.0, minY=300.0, maxX=3360.0, maxY=1500.0, width=1920.0, height=1200.0])
        else if (mouseEvent.getScreenX() >= visualBounds.getMaxX() - 1) { // MaxX returns the width? Not width -1 ?!
            savedBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());

            stage.setX(visualBounds.getWidth() / 2 + visualBounds.getMinX());
            stage.setY(visualBounds.getMinY());
            // Respect Stage Max size
            double width = visualBounds.getWidth() / 2;
View Full Code Here

TOP

Related Classes of javafx.geometry.BoundingBox

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.