/home/ssingh6/NetBeansProjects/CS1/src/npw/PumpItUp.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 import java.awt.Color;
  8 import painter.SPainter;
  9 import shapes.SSquare;
 10 import javax.swing.SwingUtilities;
 11 
 12 
 13 /**
 14  *
 15  * @author ssingh6
 16  */
 17 public class PumpItUp {
 18 
 19     /**
 20      * @param args the command line arguments
 21      */
 22     private void paintTheImage()
 23     {
 24      SPainter painter = new SPainter("Pump It Up",600,600);
 25      SSquare square = new SSquare(150);
 26      paintYellowSquare(painter,square);
 27     paintRedSquares(painter,square);
 28      paintBlueSquares(painter,square);
 29      paintGraySquares(painter,square);
 30      
 31     }
 32 
 33     private void paintRedSquares(SPainter painter, SSquare square) {
 34        
 35       painter.setColor(Color.RED);
 36         painter.mlt(square.side());
 37         painter.mfd(square.side());
 38       painter.paint(square);
 39       painter.setColor(Color.RED);
 40       painter.mrt(square.side());
 41       painter.mrt(square.side());
 42       painter.paint(square);
 43       
 44       
 45      // painter.setColor(Color.RED);
 46       //painter.paint(square);
 47        // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
 48    }
 49 
 50    private void paintYellowSquare(SPainter painter, SSquare square) {
 51        
 52         painter.setColor(Color.yellow);
 53         painter.paint(square);
 54         //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
 55     }
 56 
 57     private void paintBlueSquares(SPainter painter, SSquare square) {
 58         painter.setColor(Color.BLUE);
 59         painter.mbk(square.side());
 60         painter.mbk(square.side());
 61         painter.paint(square);
 62         painter.setColor(Color.BLUE);
 63         painter.mlt(square.side());
 64         painter.mlt(square.side());
 65         painter.paint(square);
 66         
 67        // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
 68     }
 69 
 70     private void paintGraySquares(SPainter painter, SSquare square) {
 71         painter.setColor(Color.GRAY);
 72        painter.mrt(square.side());
 73         painter.paint(square);
 74         painter.setColor(Color.GRAY);
 75         painter.mfd(square.side());
 76         painter.mlt(square.side());
 77         painter.paint(square);
 78         painter.setColor(Color.GRAY);
 79         painter.mfd(square.side());
 80         painter.mrt(square.side());
 81         painter.paint(square);
 82         painter.setColor(Color.GRAY);
 83         painter.mrt(square.side());
 84         painter.mbk(square.side());
 85         painter.paint(square);
 86        // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
 87     }
 88         
 89     
 90     
 91     public PumpItUp()
 92     {
 93         paintTheImage();
 94     }
 95     public static void main(String[] args)
 96     {
 97         SwingUtilities.invokeLater(new Runnable() {
 98             public void run() {
 99                 new PumpItUp();
100             }
101         });
102     }
103 }
104 
105 
106             
107