Java examples for JavaFX:Rectangle
union two JavaFX Rectangle
//package com.java2s; import javafx.geometry.Point2D; import javafx.scene.shape.Rectangle; public class Main { static public Rectangle union(Point2D a, Point2D b) { double x = Math.min(a.getX(), b.getX()); double y = Math.min(a.getY(), b.getY()); double width = Math.abs(a.getX() - b.getX()); double height = Math.abs(a.getY() - b.getY()); return new Rectangle(x, y, width, height); }/*w w w.j a v a2 s . com*/ }