/home/jfernan6/NetBeansProjects/CSX/src/npw/Dots.java |
1
2
3
4 package npw;
5
6 import java.awt.Color;
7 import javax.swing.SwingUtilities;
8 import painter.SPainter;
9 import shapes.SCircle;
10
11
12
13 @author
14
15 public class Dots {
16
17
18 @param args
19
20
21 private void paintTheImage() {
22 SPainter fox = new SPainter("Dots", 600,600);
23 SCircle circle = new SCircle(25);
24 paintBlueDots(fox,circle);
25 paintPinkDots(fox,circle);
26 paintGreenDots(fox,circle);
27 }
28 public Dots (){
29 paintTheImage();
30 }
31 public static void main(String[] args) {
32 SwingUtilities.invokeLater(new Runnable(){
33 public void run(){
34 new Dots ();
35 }
36 });
37 }
38 private void paintBlueDots(SPainter fox, SCircle circle) {
39 fox.setColor(Color.CYAN);
40 fox.paint(circle);
41 fox.mbk(70);
42 fox.paint(circle);
43 }
44 private void paintGreenDots(SPainter fox, SCircle circle) {
45 fox.setColor(Color.GREEN);
46 fox.moveToCenter();
47 fox.mlt(220);
48 circle.setRadius(45);
49 fox.paint(circle);
50 fox.mbk(120);
51 fox.paint(circle);
52 }
53 private void paintPinkDots(SPainter fox, SCircle circle) {
54 fox.setColor(Color.PINK);
55 fox.moveToCenter();
56 fox.mrt(170);
57 circle.setRadius(70);
58 fox.paint(circle);
59 fox.mfd(150);
60 fox.paint(circle);
61 fox.mbk(300);
62 fox.paint(circle);
63 }
64 }