Here you can find the source of subtractInsets(Rectangle base, Insets insets)
Parameter | Description |
---|---|
base | input rectangle |
insets | amount that should be excluded from the edges of the base rectangle |
public static Rectangle subtractInsets(Rectangle base, Insets insets)
//package com.java2s; //License from project: LGPL import java.awt.Insets; import java.awt.Rectangle; public class Main { /**/*www .j a v a2 s. c o m*/ * Returns the rectangle that results from removing the insets from * a given rectangle. * * @param base input rectangle * @param insets amount that should be excluded from the edges of * the base rectangle * @return new, smaller rectangle */ public static Rectangle subtractInsets(Rectangle base, Insets insets) { return new Rectangle(base.x + insets.left, base.y + insets.top, base.width - insets.left - insets.right, base.height - insets.top - insets.bottom); } }