1 /* 2 *Program to paint a dots in the context of the Nonrepresentational 3 * Painting World, NPW. 4 */ 5 package npw; 6 import java.awt.Color; 7 import javax.swing.SwingUtilities; 8 import painter.SPainter; 9 import shapes.SCircle; 10 11 public class Dots { 12 //Solution to the Blue Dot Problem 13 private void paintTheImage() { 14 SPainter pollock = new SPainter("Dots", 600,600); 15 SCircle dot = new SCircle(20); 16 pollock.setColor(Color.BLUE); 17 pollock.paint(dot); 18 19 pollock.mrt(80); 20 pollock.setColor(Color.green); 21 dot.x2(); 22 pollock.paint(dot); 23 pollock.moveToCenter(); 24 dot.s2(); 25 26 pollock.mlt(80); 27 pollock.setColor(Color.red); 28 dot.x2(); 29 pollock.paint(dot); 30 pollock.moveToCenter(); 31 dot.s2(); 32 33 pollock.mfd(100); 34 pollock.setColor(Color.yellow); 35 dot.x3(); 36 pollock.paint(dot); 37 dot.s3(); 38 39 pollock.mrt(100); 40 pollock.setColor(Color.blue); 41 pollock.paint(dot); 42 43 pollock.mlt(200); 44 pollock.paint(dot); 45 pollock.moveToCenter(); 46 47 pollock.mbk(150); 48 pollock.setColor(Color.yellow); 49 dot.x5(); 50 pollock.paint(dot); 51 dot.s5(); 52 53 pollock.mrt(240); 54 pollock.paint(dot); 55 56 57 pollock.mlt(480); 58 pollock.paint(dot); 59 pollock.moveToCenter(); 60 61 62 63 64 65 66 67 68 69 } 70 //REQUIRED INFRASTRUCTURE 71 72 73 public Dots() { 74 paintTheImage(); 75 } 76 77 public static void main(String[] args){ 78 SwingUtilities.invokeLater(new Runnable() { 79 public void run() { 80 new Dots(); 81 } 82 }); 83 } 84 } 85 86