round Rectangle2D to RoundRectangle2D - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

round Rectangle2D to RoundRectangle2D

Demo Code


//package com.java2s;

import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;

public class Main {
    public static RoundRectangle2D.Double round(
            final Rectangle2D rectangle2D, final double arcW,
            final double arcH) {
        return new RoundRectangle2D.Double(rectangle2D.getX(),
                rectangle2D.getY(), rectangle2D.getWidth(),
                rectangle2D.getHeight(), arcW, arcH);
    }/*from   w  w w .  j  a va  2  s  .c  o  m*/
}

Related Tutorials