from Bounds JavaFX Rectangle - Java JavaFX

Java examples for JavaFX:Rectangle

Description

from Bounds JavaFX Rectangle

Demo Code


//package com.java2s;
import static java.util.Objects.requireNonNull;
import javafx.geometry.Bounds;

import javafx.geometry.Rectangle2D;

public class Main {
    public static Rectangle2D fromBounds(Bounds bounds) {
        requireNonNull(bounds, "bounds is null");

        return new Rectangle2D(bounds.getMinX(), bounds.getMinY(),
                bounds.getWidth(), bounds.getHeight());
    }//from  w  w w  .  j  av  a  2s  .co m
}

Related Tutorials