1 package npw; 2 3 import painter.SPainter; 4 import painter.SPainterADT; 5 import shapes.SCircle; 6 import shapes.SSquare; 7 8 import java.awt.*; 9 10 public class Invention1 { 11 12 13 public static void main(String[] args) { 14 SCircle circle = new SCircle(25); 15 SSquare square = new SSquare(100); 16 SPainter art = new SPainter("Invention", 600, 600); 17 18 art.moveToCenter(); 19 art.setColor(Color.BLACK); 20 art.paint(square); 21 art.paint(circle); 22 23 24 int x = 1; 25 while (x < 5) { 26 art.mlt(55); 27 art.mfd(55); 28 art.setColor(Color.RED); 29 art.paint(square); 30 x = x + 1; 31 } 32 art.moveToCenter(); 33 x=1; 34 while (x < 15) { 35 if (x > 5) { 36 art.setColor(Color.MAGENTA); 37 art.mlt(20); 38 art.mbk(50); 39 art.paint(circle); 40 } else { 41 art.setColor(Color.PINK); 42 art.mfd(36); 43 art.paint(circle); 44 } 45 art.mrt(20); 46 art.mfd(15); 47 x = x + 1; 48 } 49 50 } 51 } 52 53