compact Rectangle2D - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

compact Rectangle2D

Demo Code


//package com.java2s;

import java.awt.geom.Rectangle2D;

public class Main {
    public static Rectangle2D compactRectangle2D(Rectangle2D r,
            double insetX, double insetY) {
        return new Rectangle2D.Double(r.getX() + insetX, r.getY() + insetY,
                r.getWidth() - insetX * 2, r.getHeight() - insetY * 2);
    }//from w ww  .ja va  2 s .  c om
}

Related Tutorials