Java examples for 2D Graphics:Rectangle
expand Rectangle 2D
//package com.java2s; import java.awt.geom.Rectangle2D; public class Main { public static Rectangle2D expandRectangle2D(Rectangle2D r, double dx, double dy) { return new Rectangle2D.Double(r.getX() - dx, r.getY() - dy, r.getWidth() + dx * 2, r.getHeight() + dy * 2); }/* www . ja v a 2s .c o m*/ }