Here you can find the source of fits(Rectangle2D o1, Rectangle2D o2)
Parameter | Description |
---|---|
o1 | rectangle to be contained |
o2 | rectangle to be the container |
public static boolean fits(Rectangle2D o1, Rectangle2D o2)
//package com.java2s; //License from project: Creative Commons License import java.awt.geom.Rectangle2D; public class Main { /**/*from w w w .j a v a 2 s . c o m*/ * Takes two rectangles and check if the first fits into the second * * @param o1 rectangle to be contained * @param o2 rectangle to be the container * @return true if o1 fits into o2, false otherwise * @see Rectangle2D */ public static boolean fits(Rectangle2D o1, Rectangle2D o2) { return (o1.getHeight() <= o2.getHeight() && o1.getWidth() <= o2.getWidth()); } }