//StarTestQuit.java - added a quit button to StarTest
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


class StarTestQuit extends JFrame 
{
  static Star star;
  
  private Container screen;
  private GridBagLayout layout;
  private GridBagConstraints constraints; 
	
  private void addComponent( Component component, int row, int column, int width, int height )
  {
	constraints.gridx = column;
	constraints.gridy = row;

    constraints.gridwidth = width;   
    constraints.gridheight = height;

    layout.setConstraints(component, constraints);  
    screen.add(component);      
  }

  public static void main(String[] args) 
  {
  	new StarTestQuit();
  }
  
  StarTestQuit() 
  {
  	super ("Sine Graph");
  	screen = getContentPane();
  	layout = new GridBagLayout();
  	screen.setLayout(layout);
  	constraints = new GridBagConstraints();
  	
    star = new Star();

    //Changes from StarTest are below here
    JButton quit = new JButton("Quit");
    quit.addActionListener(new GoodBye());

    JButton zoomin = new JButton("Zoom in");
    zoomin.addActionListener(
		new ActionListener()  
		{  
			public void actionPerformed(ActionEvent e) 
  			{
   				star.RADIUS += 10;
				star.paint(star.getGraphics());
    			/*screen.pack();*/
  	
  			}
  		}
	
	);
	
	
    JButton zoomout = new JButton("Zoom out");
	zoomout.addActionListener(
		new ActionListener()  
		{  
			public void actionPerformed(ActionEvent e) 
  			{
   				star.RADIUS -= 10;
				star.paint(star.getGraphics());
    			/*frame.pack();*/
  	
  			}
  		}
	
	);
	
    addComponent(quit,0,0,1,1);
    addComponent(zoomin,1,0,1,1);
    addComponent(zoomout,2,0,1,1);
    addComponent(star,0,1,1,4);
    
    pack();
    setVisible(true);	
  
  }
}
