下面列出了java.awt.geom.RectangularShape#clone ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Resizes a rectangle. This works for real rectangles and produces funny results for RoundRects etc ..
*
* @param rectangularShape
* the rectangle
* @param width
* the new width of the rectangle
* @param height
* the new height of the rectangle.
* @return the resized rectangle.
*/
public static Shape resizeRect( final RectangularShape rectangularShape, final double width, final double height ) {
final RectangularShape retval = (RectangularShape) rectangularShape.clone();
retval.setFrame( retval.getX(), retval.getY(), width, height );
return retval;
}