Java examples for 2D Graphics:Arc
Creates a rounded clipped shape with the given shapeWidth, shapeHeight, arc width and arc height.
//package com.java2s; import java.awt.*; import java.awt.geom.*; public class Main { /**//from www . ja v a 2 s .c om * Creates a rounded clipped shape with the given <tt>shapeWidth</tt>, * <tt>shapeHeight</tt>, arc width and arc height. * @param shapeWidth the width of the shape to create * @param shapeHeight the height of the shape to create * @param arcW the width of the arc to use to round the corners of the * newly created shape * @param arcH the height of the arc to use to round the corners of the * newly created shape * @return the created shape */ public static Shape createRoundedClipShape(int shapeWidth, int shapeHeight, int arcW, int arcH) { return new RoundRectangle2D.Float(0, 0, shapeWidth, shapeHeight, arcW, arcH); } }