}\r
public static class ShapeExtention\r
{\r
+ public static void draw(this Shape drawee, double c)\r
+ {\r
+ drawee.draw( new Color(c) );\r
+ }\r
public static void draw(this Shape drawee, Color c)\r
{\r
Color tmp_col = drawee.fill;\r
{\r
set(v1, v2);\r
}\r
- public void set(double x1, double y1, double x2, double y2)\r
+ public Line set(double x1, double y1, double x2, double y2)\r
{\r
begin.set(x1, y1);\r
end.set(x2, y2);\r
+ return this;\r
}\r
- public void set(Point v1, Point v2)\r
+ public Line set(Point v1, Point v2)\r
{\r
begin = v1;\r
end = v2;\r
+ return this;\r
}\r
\r
public Figure shift(Point p)\r
return this;\r
}\r
\r
- public void draw()\r
+ public virtual void draw()\r
{\r
Main.drawable.line(this);\r
}\r
return this;\r
}\r
\r
- public void draw()\r
+ public virtual void draw()\r
{\r
Main.drawable.rect(this);\r
}\r
ydiameter = hei;\r
return this;\r
}\r
+ public Ellipse resize(double width, double height)\r
+ {\r
+ Point po = center;\r
+ set(width, height);\r
+ centering(po);\r
+ return this;\r
+ }\r
public Figure shift(Point p)\r
{\r
datum += p;\r
return this;\r
}\r
\r
- public void draw()\r
+ public virtual void draw()\r
{\r
Main.drawable.ellipse(this);\r
}\r
return this;\r
}\r
\r
- public void draw()\r
+ public virtual void draw()\r
{\r
Main.drawable.polygon(this);\r
}\r