99import org .teachingextensions .logo .Paintable ;
1010import org .teachingextensions .windows .ProgramWindow ;
1111
12+ /**
13+ * <img src="http://www2.psd100.com/ppp/2013/11/2701/Blue-circle-1127210229.png" align="left" >
14+ * The Circle allows you to draw circles on the canvas
15+ */
1216public class Circle implements Paintable
1317{
1418 private final int radius ;
@@ -21,22 +25,54 @@ public Circle(int radius, Color color)
2125 this .radius = radius ;
2226 this .mainColor = color ;
2327 }
28+ /**
29+ * Sets the center the circle
30+ * <div><b>Example:</b> {@code circle.setCenter(8,10)}</div>
31+ *
32+ * @param x
33+ * The x value
34+ * @param y
35+ * The y value
36+ */
2437 public void setCenter (int x , int y )
2538 {
2639 this .x = x ;
2740 this .y = y ;
2841 }
42+ /**
43+ * Adds a circle to the window
44+ * <div><b>Example:</b> {@code circle.addTo(panel)}</div>
45+ *
46+ * @param panel
47+ * the ProgramWindow or panel
48+ */
2949 public void addTo (ProgramWindow panel )
3050 {
3151 panel .addPaintable (this );
3252 }
53+ /**
54+ * Paints a circle
55+ * <div><b>Example:</b> {@code circle.paint(g,caller)}</div>
56+ *
57+ * @param g
58+ * the graphics object
59+ * @param caller
60+ * the Program Window or panel
61+ */
3362 @ Override
3463 public void paint (Graphics2D g , JPanel caller )
3564 {
3665 Color color2 = Colors .getTransparentVersion (mainColor , percentTransparent );
3766 g .setColor (color2 );
3867 g .fillOval (x - radius , y - radius , radius * 2 , radius * 2 );
3968 }
69+ /**
70+ * Sets the transparency of the circle
71+ * <div><b>Example:</b> {@code circle.setTransparency(80)}</div>
72+ *
73+ * @param percentTransparent
74+ * The percentage of transparency of the circle
75+ */
4076 public void setTransparency (int percentTransparent )
4177 {
4278 this .percentTransparent = percentTransparent ;
0 commit comments