本文整理汇总了Java中java.awt.geom.RoundRectangle2D.getWidth方法的典型用法代码示例。如果您正苦于以下问题:Java RoundRectangle2D.getWidth方法的具体用法?Java RoundRectangle2D.getWidth怎么用?Java RoundRectangle2D.getWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.RoundRectangle2D
的用法示例。
在下文中一共展示了RoundRectangle2D.getWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cloneShape
import java.awt.geom.RoundRectangle2D; //导入方法依赖的package包/类
/**
* Clone's the shape provided.
*
* @param aShape shape to be cloned
*
* @return a cloned version of the provided shape
*/
public Shape cloneShape(final Shape aShape) {
if (aShape instanceof Rectangle2D) {
return new PBounds((Rectangle2D) aShape);
}
else if (aShape instanceof Ellipse2D) {
final Ellipse2D e2 = (Ellipse2D) aShape;
return new Ellipse2D.Double(e2.getX(), e2.getY(), e2.getWidth(), e2.getHeight());
}
else if (aShape instanceof Arc2D) {
final Arc2D a2 = (Arc2D) aShape;
return new Arc2D.Double(a2.getX(), a2.getY(), a2.getWidth(), a2.getHeight(), a2.getAngleStart(), a2
.getAngleExtent(), a2.getArcType());
}
else if (aShape instanceof RoundRectangle2D) {
final RoundRectangle2D r2 = (RoundRectangle2D) aShape;
return new RoundRectangle2D.Double(r2.getX(), r2.getY(), r2.getWidth(), r2.getHeight(), r2.getArcWidth(),
r2.getArcHeight());
}
else if (aShape instanceof Line2D) {
final Line2D l2 = (Line2D) aShape;
return new Line2D.Double(l2.getP1(), l2.getP2());
}
else {
final GeneralPath aPath = new GeneralPath();
aPath.append(aShape, false);
return aPath;
}
}