/home/ssingh6/NetBeansProjects/CS1/src/npw/Invention1.java
 1 /*
 2  * To change this license header, choose License Headers in Project Properties.
 3  * To change this template file, choose Tools | Templates
 4  * and open the template in the editor.
 5  */
 6 package npw;
 7 
 8 import java.awt.Color;
 9 import painter.SPainter;
10 import shapes.SCircle;
11 import shapes.SSquare;
12 
13 /**
14  *
15  * @author ssingh6
16  */
17 public class Invention1 {
18 
19     /**
20      * @param args the command line arguments
21      */
22     public static void main(String[] args) {
23         SPainter painter = new SPainter("Invention 1", 600, 600);
24          SSquare square = new SSquare(560);
25         SCircle circle = new SCircle(280);
26          painter.setBrushWidth(5);
27          painter.setColor(Color.BLUE);
28          paintTheImage(square, circle, painter);
29  
30      }
31 
32      private static void paintTheImage(SSquare square, SCircle circle, SPainter painter) {
33          double side = square.side();
34          while (side > 40) {
35             painter.draw(square);
36              painter.draw(circle);
37             square.s3();
38             square.x2();
39              side = square.side();
40              if (side < 200) {
41                 painter.setColor(Color.RED);
42              }
43                  
44          }
45      }
46  
47  }
48        
49