*/
public static Shape clone(Shape shape) {
Shape result = null;
if (shape instanceof Line2D) {
Line2D line = (Line2D) shape;
result = (Shape) line.clone();
}
// RectangularShape includes: Arc2D, Ellipse2D, Rectangle2D, RoundRectangle2D.
else if (shape instanceof RectangularShape) {
RectangularShape rectangle = (RectangularShape) shape;
result = (Shape) rectangle.clone();